#P288. 【例47.3】 最大公约数

【例47.3】 最大公约数

Description

Given two positive integers, find their greatest common divisor (GCD).

Input Format

The first line contains an integer nn (0<n1000 < n ≤100), indicating the number of test cases.
Each of the following nn lines contains two integers xx and yy (0<x,y100000 < x,y≤10000).

Output Format

Output the greatest common divisor for each test case.

Sample

3
6 6
12 11
33 22
6
1
11