For every natural , let be the smallest natural such that ends with and is a multiple of 7. For instance, , , , …, , , , , , … Let be the infinite concatenation of for every , that is, . Which is the -th digit of ?
Input consists of several cases, each with a natural between 1 and .
For every , print the -th digit of (starting at one).
Input
1 2 3 4 13 14 15 18 19 20 1000000000000 1000000000000000
Output
2 1 4 2 7 2 8 2 1 0 4 5