A number B is a subset of number A if you can delete some digits from number A to the remaining digits from number B.
You are given an N-digit number X and XK is the largest K-digit subtype of the number X.
You must answer M queries. Each query consists of two numbers K and L. The answer to the query is the Lth digit of the number XK.
Input format
Output format
The output must contain one line of length M in which the ith character is a response to the ith query.
Constraints
1≤N≤1051≤M≤1051≤Ki≤N1≤Li≤Ki
In first queries subnumber is 96, second digit = 6.
In second queries subnumber is 926, first digit = 9.