A radio station broadcasts a signal that never stops.
The transmission starts as a single digit, . Every time the operator has written down a block of digits, the station repeats that whole block inverted - every comes back as a and every comes back as a - and the inverted copy is appended to everything written so far.
So the transcript grows like this:
1
1 0
1 0 0 1
1 0 0 1 0 1 1 0
Given a position , report the digit standing at that position. Positions are numbered starting from .
Input
First line of input will be a single integer - the number of testcases.
Each of the next lines contains a single integer - the position in the signal.
Output
For every testcase print a single line with the digit ( or ) at position .
Example
6 1 7 8 15 1234 12345678
1 1 0 0 0 1
The signal begins , so position and position hold a , while position holds a .
Constraints
This problem was adapted, with permission, from Morzeov niz, authored by Društvo matematičara Srbije and Fondacija Petlja.