SP2906 GCD2 - GCD2

Description

Frank explained its friend Felman the algorithm of Euclides to calculate the GCD of two numbers. Then Felman implements it algorithm ``` int gcd(int a, int b) { if (b==0) return a; else return gcd(b,a%b); } ``` and it proposes to Frank that makes it but with a little integer and another integer that has up to 250 digits. Your task is to help Frank programming an efficient code for the challenge of Felman.

Input Format

The first line of the input file contains a number representing the number of lines to follow. Each line consists of two number A and B (0

Output Format

Print for each pair (A,B) in the input one integer representing the GCD of A and B.