The greatest common divisor (GCD) of two integers is the largest positive integer that divides both numbers without a remainder. For example, the GCD of 8 and 12 is 4. Write a program that finds the GCD of two positive integers.
The first line contains a positive integer $n$, the number of problem sets. Each of the following problem sets consists of two positive integers separated by one or more spaces. There are no blank lines in the input.
For each problem set, print the GCD of the two positive integers, one per line.