You are given the sequence: 0123456789101112131415...
The 0th digit of this sequence is 0, the 1st digit of this sequence is 1, the 2nd digit of this sequence is 2 and so on. You will be given some queries. Each query will ask you to print the digit at the ith position for some i.

Input:
The first line of the input contains a single integer T denoting the number of test cases. ThenT test cases follow. Each test case consist of one line which contains a positive integer i, which asks you to print the ith digit in the sequence given.

Output:
Corresponding to each test case, in a new line, print the digit at that position.

Constraints:
1 ≤ T ≤ 2000
1 ≤ Query Value ≤ 10^{5}