Simple Game
Tolia and Serhiyko are playing a turn-based mathematical game. They start with a set of natural numbers. On each turn, a player must decrease one of these numbers by a prime number, ensuring the result is still a natural number. The player who cannot make a move loses. Your task is to determine Tolia's chances of winning if he goes first and both players use optimal strategies.
Input
The first line contains the number of test cases, 1 ≤ K ≤ 10. Each of the following K lines contains a sequence of natural numbers (up to 100 numbers per line), each not exceeding 100.
Output
Output a single line with K
digits, each either 1 or 0, corresponding to each test case. A 1
indicates that Tolia has a winning strategy, while a 0
indicates that Serhiyko will win. Write these digits consecutively without spaces.