Triangle War is a two-player game played on the following triangular grid:

The 10 dots are numbered 1 to 10, from the top row down and from left to right inside each row. Dot 1 sits on the first row, dots 2 and 3 on the second, dots 4, 5, 6 on the third, and dots 7, 8, 9, 10 on the fourth. The 18 dotted lines join neighbouring dots and cut the grid into 9 small triangles.
Two players, A and B, take turns filling in any dotted line connecting two dots, with A starting first. Once a line is filled, it cannot be filled again. If the line filled by a player completes one or more triangles, she owns the completed triangles and she is awarded another turn, so the opponent skips a turn. For example, if A fills in the line between 2 and 5 in the partial game on the left below:

Then she owns the triangle labelled A and takes another turn to fill in the line between 3 and 5. B can now own 3 triangles (if he wishes) by filling in the line between 2 and 3, then the one between 5 and 6, and finally the one between 6 and 9. B would then make one more move before it is A's turn again.
The game ends after all dotted lines are filled in, and the player with the most triangles wins the game. The difference in the number of triangles owned by the two players is not important.
You are given a number of moves that have already been made. From that partial game, decide which player wins if each player plays a perfect game from that point on, that is, each player always chooses the play that leads to the best possible outcome for himself or herself.
The first line holds a positive integer, the number of games that follow.
Each game starts with a line holding an integer m (6≤m≤18), the number of moves that have been made in that game. The next m lines give those moves in order, each of the form i j, meaning the line between dot i and dot j was filled in on that move, with i<j. All given moves are legal.
For each game, print the game number and the result on one line. If A wins, print Game k: A wins. and if B wins, print Game k: B wins., where k is the number of the game, counting from 1.