Loading...
Game On Space
Time: 1 s
Memory: 125 MB
Tajbin and Tanvir live in an n-dimensional space known as N-WayLand. Here, they want to play a game. In this game, they start with a ball positioned at the origin of this space and take turns moving it. Each turn allows them to push the ball along one of the positive axes in the space. Before starting the game, they set specific limits on how far they can move the ball along each axis, which defines the maximum allowable distance for that dimension.
Here's how they can move the ball along each dimension:
- They can move the ball from 1 unit up to half of the remaining distance along an axis.
- If, for instance, the maximum distance for the X-axis is 9, in the first move, they can advance the ball by 1, 2, 3, or 4 units. If they opt for 3 units, the remaining distance for the X-axis becomes 9 - 3 = 6. In the second move, they can then move the ball by 1, 2, or 3 units in the X-axis.
The player who can't make a valid move loses the game. Tajbin initiates the game. Can you tell us who will win the game if both play optimally?
Example Gameplay
If they reside in a 2-dimensional space and the maximum distance for the first dimension is 5, while the second dimension allows a maximum of 4 units of movement, they begin with the ball at the position (0, 0).
The gameplay proceeds as follows:
1. Tajbin selects the first dimension and can move the ball by either 1 or 2 units. Let's say she chooses 1 unit. The ball is now at position (1, 0).
2. Tanvir chooses the first dimension as well. In this dimension, there are 5 - 1 = 4 units remaining, so he can move the ball by either 1 or 2 units. Suppose he chooses 2 units. The ball is now at position (3, 0).
3. Tajbin decides to move 2 units in the second dimension, bringing the ball to position (3, 2).
4. Tanvir moves 1 unit in the first dimension, advancing the ball to (4, 2).
5. Tajbin moves 1 unit in the second dimension, shifting the ball to (4, 3).
At this point, Tanvir cannot make a valid move, and therefore, he loses the game. Tajbin emerges as the winner.
Input
The first line contains an integer, n (1 ≤ n ≤ 10^5), representing the number of dimensions in the space.
The second line contains n space-separated integers, a[i] (1 ≤ a[i] ≤ 10^16), where a[i] represents the maximum distance the ball can move along the i-th dimension.
Output
Output a single line containing the name of the player who can win the game:
If the first player (Tajbin) can win, print "Tajbin" (without quotes).
If the second player (Tanvir) can win, print "Tanvir" (without quotes).
Examples
Input
Output
2
5 4
Tajbin
Input
Output
2
4 4
Tanvir
Problem Info
Problem ID 200
Time Limit 1000 ms
Memory Limit 128000 KB
Moderators Tajbin_Jahan , Alom_Shanto , Falak_Ahmed_Shakib
Statistics
Submit
You need to Login or Registration for submit your solution