Consider a string A = "12345". An infinite string s is built by performing infinite steps on A recursively. In ith step, A is concatenated with ‘$’ i times followed by reverse of A.
A=A|$...$|reverse(A), where | denotes concatenation. Input :
First line contains an integer Q, the number of queries. Q line follows. Each line contains an integer POS i.e. the position for query.
For each query print the character in the infinite string at position POS in separate lines.