Longing, loneliness, pain, the breath of night – This, of course, is not at all what you want Flёur
Vasya loves the game of Grundy. Unfortunately, no one loves Vasya. Thus, he has no one to play this game with, and he does not care about who wins. The only thing that interests Vasya in life is determining the Grundy numbers for various piles in the Grundy game. Day and night, he calculates these numbers. You would be a heartless person if you do not help Vasya finish his calculations as quickly as possible, so he can move on to searching for a job, a girlfriend, or the meaning of life.
Let us recall the rules of the Grundy game. Initially, there is one pile of stones. On each turn, a player chooses any existing pile and splits it into two non-empty piles of stones so that the sizes are different. The player who cannot make a move loses.
The first line contains an integer (1 \leq N \leq 10^4) – the number of queries. Each of the following lines contains a single integer b_i (1 \leq b_i \leq 10^4) – the size of the respective pile.
For each query, output the Grundy number of the respective pile, one per line.
Example 1