Grid Game 3-angle
시간 제한1초메모리 제한2048 MB
삼각 격자의 한 칸에서 돌을 1개 이상 K개 이하로 덜어내고 아래쪽 도달 가능한 칸으로 최대 K개를 옮길 수 있을 때, 두 사람이 최적으로 두면 누가 이기는지 판정한다.
문제
Your friends, Anda and Kamu decide to play a game called Grid Game and ask you to become the gamemaster. As the gamemaster, you set up a triangular grid of size . The grid has rows (numbered from to ). Row has cells; the th cell of row is denoted as .

Before the game starts, different cells (numbered from to ) are chosen: at cell , you add stones on it. You then give Anda and Kamu an integer and commence the game.
Anda and Kamu will take turns alternately with Anda taking the first turn. A player on their turn will do the following.
- Choose a cell with at least one stone on it.
- Remove at least one but at most stones from the chosen cell.
- For each cell such that and , add zero or more stones but at most stones to cell .
The following illustrations show all the possible cells in which you can add stones for . You choose the cell for the left illustration and the cell for the right illustration.

A player who is unable to complete their turn (because there are no more stones on the grid) will lose the game, and the opposing player wins. Determine who will win the game if both players play optimally.
입력
This problem is a multi-case problem. The first line consists of an integer () that represents the number of test cases.
Each test case starts with a single line consisting of three integers (; ). Then, each of the next lines consists of three integers (; ). The pairs are distinct.
The sum of across all test cases does not exceed .
출력
For each case, output a string in a single line representing the player who will win the game if both players play optimally. Output Anda if Anda, the first player, wins. Otherwise, output Kamu.