Roy is looking for Wobbly Numbers.
An N-length wobbly number is of the form "ababababab..." and so on of length N, where \(a != b\).
A 3-length wobbly number would be of form "aba".
Eg: \(101, 121, 131, 252, 646\) etc
But \(111, 222, 999\) etc are not 3-length wobbly number, because here \(a != b\) condition is not satisfied.
Also \(010\) is not a 3-length wobbly number because it has preceding 0. So \(010\) equals \(10\) and \(10\) is not a 3-length wobbly number.
A 4-length wobbly number would be of form "abab".
Eg: \(2323, 3232, 9090, 1414\) etc
Similarly we can form a list of N-length wobbly numbers.
Now your task is to find K\(th\) wobbly number from a lexicographically sorted list of N-length wobbly numbers. If the number does not exist print 1 else print the Kth wobbly number. See the sample test case and explanation for more clarity.
Input:
First line contains T - number of test cases
Each of the next T lines contains two space separated integers - N and K.
Output:
For each test case print the required output in a new line.
Constraints:
\(1 ≤ T ≤ 100\)
\(3 ≤ N ≤ 1000\)
\(1 ≤ K ≤ 100\)