Under construction

Still being built. Things may change

Lonely Gomgomi Has Friends

Interview

Time limit1sMemory limit1024 MB

Summary
Given each friend's start point and allowed step lengths, decide whether the friend can reach the origin by moving axis-aligned by those lengths.
Level

Medium4 of 10

Topics
Number theory, Math
Solved
No attempts yet

Problem

Today is Gomgomi's birthday.

For several days, Gomgomi has sent party invitations to friends and has looked forward to a fun birthday party.

Then why is Gomgomi alone right now...?

Are the friends unable to find the way...?

Surely they can't come to the party either...?

Gomgomi is at the origin (0,0)(0, 0) of an infinite two-dimensional coordinate plane.

Each time a friend moves, the friend can pick one of the given distances and move that distance in one of the four directions: up, down, left, or right.

Given each friend's starting position and the distances that friend can move, check whether that friend can come to Gomgomi's birthday party.

Input

The first line contains the number of friends NN (1≤N≤100001 \le N \le 10000).

Each friend's information is given on two lines.

The first line of the ii-th friend's information contains the starting position XiX_i, YiY_i (−100000≤Xi,Yi≤100000-100000 \le X_i, Y_i \le 100000), separated by a space.

The second line of the ii-th friend's information contains the number of distances KiK_i (1≤Ki≤321 \le K_i \le 32), followed by KiK_i distances AijA_{ij} (1≤Aij≤1000001 \le A_{ij} \le 100000, 1≤j≤Ki1 \le j \le K_i), separated by spaces.

All input values are integers.

Output

Print NN lines.

If the ii-th friend cannot come to the party, print Gave up on the ii-th line. If the friend can come, print Ta-da.

Examples1

  1. Example 1

    Input
    3
    10 10
    4 1 2 3 4
    21 0
    1 21
    10 -6
    2 3 9
    
    Expected output
    Ta-da
    Ta-da
    Gave up