A. battles Fibonacci
Single-point time: 1.0 sec
Memory Limit: 512 MB
After the small z learned Fibonacci and gcd, the teacher gave him out of a problem, find the N-th and M-th greatest common divisor of that deed Fibonacci numbers, which can be a difficult task for small z, but in small z is the repeated request, the teacher told him condition, gcd (N, M) ∈ [1,90].
However, the small z clumsy or not, then ask you to help him answer this question.
Input Format
T group including input, T∈ [1,10].
Next T lines of two integers N, M, represents Fibonacci item item M and N, (N, M∈ [1,10 18 ]).
Output Format
Containing T output lines, each output an integer.
Sample
input
3
1 2
2 3
3 4
output
1
1
1