Problem hidden

VGCD - The Very Greatest Common Divisor

Given two integers a and b find their greatest common divisor.

Input

The first line of the input file contains number 0 < n < 1000 the amount of tests. The description of n test cases follow. The description of a test case consists of two lines. The first line contains integer a (0 < a < 1012540), the second – integer b (0 < b < 1012540). It is also known that all the numbers in the input file are the determinants of the square matrix of the form:

Output

For each test case print the greatest common divisor of integers a and b on a separate line.

Example

Input:
3
2
3
3
21
6765
610

Output:
1
3
5

Adicionado por:Spooky
Data:2010-04-09
Tempo limite:1s
Tamanho do fonte:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Linguagem permitida:Todas exceto: ASM64 CLOJURE ERL FSHARP NODEJS OBJC PERL6 PY_NBC SCALA SQLITE TCL VB.NET
Origem:Open All-Ukrainian Collegiate Contest Semi-Final, 2010
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.