spoj#ADAXMAS. Ada and Christmas
Ada and Christmas
Ada the Ladybug was recently unwrapping presents and guess what? She got a new chessboard from her good friend Flea Feodorv. As he though "the bigger chessboard the better the chess game will be", he gave Ada a chessboard even bigger than last time: Now the upper-right corner is [999999999,999999999] (109-1).
As you might guess, she can't play classical (nor rapid) chess on such board. But as she doesn't to throw such valuable (well.. at least big) gift away, she've decided to play Palace Game again. She invited her friend Velvet Mite Vinit. As they played this game recently, they decided to expand the rules a little bit. They have decided to play this game with five most important chess-pieces: Rook, Bishop, King, Knight and obviously, the Palace.
The game rules are simple: A few chess-pieces are placed onto chessboard. Ada and Vinit alternate in moves. In each move one can choose any piece on chessboard and move it toward bottom-left corner. Moving toward means, that the Manhattan distance from bottom-left corner will decrease and also that none of the coordinates of chess-piece will increase. A player who can't make a move will lose. Can you tell who'll be the winner if both of them play optimally? As Ada is a lady, she goes first.
NOTE: Rules are slightly different than in original Palace Game (even though it wouldn't affect the original game, this game might yield slightly different results).
Input
The first line of input will contain 1 ≤ T ≤ 3*105, the number of test-cases.
The next T lines will contain 1 ≤ N ≤ 3*105, the number of chess pieces placed on chessboard.
Each test-case will contain N lines containing two integers and a character: 0 ≤ x, y < 109, the coordinates of chess-piece and c ∈ {T, B, K, N, P} (stands for rook(T), Bishop, King, kNight and Palace).
The sum of N over all test-cases will not exceed 3*105
Output
For each test-case output the name of winner, so either "Ada" or "Vinit".
Example Input
10 2 7 0 B 3 4 T 2 6 7 K 9 1 B 3 8 7 B 9 4 K 4 4 T 2 8 5 T 6 5 K 3 1 2 P 6 1 B 4 4 P 2 1 2 B 0 9 K 1 1 9 K 3 5 0 K 0 4 B 9 1 K 3 0 4 K 0 5 K 3 2 K 3 6 4 N 1 2 N 0 7 N
Example Output
Ada Vinit Ada Ada Ada Vinit Ada Ada Vinit Vinit