You need to find the greatest common divisor of integers and . Each number and is given as the determinant of a square matrix of the following form:

The first line contains the number of test cases (n < 250). Each test case consists of two lines. The first line contains the integer (0 < a < 10^{12540}), and the second line contains the integer (0 < b < 10^{12540}).
For each test case, print the greatest common divisor of the integers and on a separate line.
Example 1