Fibonacci String
In mathematics, often used the so-called recurrence relations. Usually they are used to define sequences of numbers, but can also be applied to define the sequence of rows.
One example of lines defined by the recurrence relation is Fibostrings . They are defined as follows: , where . The first seven strings of Fibonacci as follows: , , , , , , .
Dima is engaged in the group Olympiad programming and are interested in algorithms on strings. He recently learned about the Fibonacci strings. He quickly realized that their length with increasing number is growing very quickly, so the task of finding all the characters of requires too much memory. He therefore decided to limit the problem of finding some characters..
Write a program that finds the -th character strings .
Input
The first line contains the number of test cases . Each of the following lines contains two integers and , where is the length of the string , character positions in the line are numbered from one.
Output
Print lines, each contains exactly one character - the answer to an appropriate test case.