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.
The first line of the input contains a single integer T denoting the number of test cases. Then T 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.
Corresponding to each test case, in a new line, print the digit at that position.
1 ≤ T ≤ 2000
1 ≤ Query Value ≤ 100000
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.