9176 - GCD   

Description

Given three positive integers a, b, and c, compute the greatest common divisor (GCD) of the three numbers. The GCD of the three numbers is the biggest integer that can divide the three number with no reminder.

Input

First line contains a positive integer t (t<=1000), which indicates the number of test cases in the input. In the next t lines, each line contains three positive integers a, b, and c, which are smaller than or equal to 106.

Output

For each case, output the GCD of the three numbers in a line.

Sample Input  Download

Sample Output  Download

Tags




Discuss