Greatest Common Divisor

Time Limit : 1 sec, Memory Limit : 65536 KB

Problem A: Greatest Common Divisor

Please find the greatest common divisor of two natural numbers. A clue is: The Euclid's algorithm is a way to resolve this task.


The input file consists of several lines with two natural numbers in each line. The numbers do not exceed 100000.


Your program has to print the greatest common divisor for each pair of input numbers. Print each result on a new line.

Sample Input

57 38
60 84

Output for the Sample Input


Source: University of Aizu Programming Contest , Aizu-Wakamatsu, Japan, 2003-06-08