Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

G_C_DIVI - Greatest common divisor

For given integers a and b print the greatest common divisor of a and b.

Input

The first line of the standard input contains one integer t (t<10001) which is the number of test cases.

In each of the next t lines there are two numbers: a and b.

Output

For each test, print the greatest common divisor of a and b.

Example

Input:
3
5 5
7 5
128 164
Output:
5
1
4


Added by:Piotr KÄ…kol
Date:2010-01-12
Time limit:6.466s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS OBJC SCM qobi VB.NET

hide comments
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.