In the event of technical difficulties with Szkopuł, please contact us via email at firstname.lastname@example.org.
If you are familiar with IRC chat, the support team is also reachable on PIRC network (
#szkopul channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
Bitie and Bytie are spending their vacation at the Bytic Sea. The boys really enjoy intellectual riddles, even when they are at the beach.
This time they gathered a number of round stones that were washed ashore and started playing a new game. The rules of the game are fairly simple. In the first move Bitie can take any number of stones that is greater than zero but smaller than the total number of stones in the heap. Since then the boys alternate moves, starting from Bytie. In each move a player can take any non-zero number of stones from the heap (possibly even all the stones from the heap) provided that this number of stones was not taken in any previous move. In other words, in each move a different number of stones must be taken. The player who cannot make a move loses.
Given the number of stones in the initial heap, your task is to check if Bitie can win the game assuming that both boys play optimally.
The first line of input contains one integer (), the number of test cases.
Each of the following lines contains one integer (), the number of stones at the beginning of the game.
Your program should output lines with answers to the respective test cases. Each line should contain the word TAK (Polish for yes) or NIE (Polish for no) depending on whether Bitie can win the game.
For the input data:
the correct result is: