By Gabriel Erzinger, Universidade Federal de Itajubá Brazil
With the games coming, like in any other big event, the public security forces realize many trainings and simulations in order to be ready for anythings. Your friend David, who does'nt feel happy with his Computer Science course - result of his poor programming skills, dream to join one of the public security forces and, when he was studying about those simulations, he found the following problem:
"In a given situation, the tatical defense team must find an alarm clock - which simulates a bomb - which will have a screen showing two numbers A and B. To disarm the bomb, the team need to write the Gratest Common Divisor of all numbers from A to B."
Nobody knows why someone would simulate a bomb which such requisit, but, David is curious to know which should be the correct numbers to stop the bomb. As you know, he's not good with those 'programming or math stuff' so, he asks your help to find out the answer to the following problem:
"Given two integers A and B, print the greates common divisor of all integers in the interval [A, A+1, A+2, ... B]"
The input start with an integer T that represents the number of test cases. Follows T lines, each one with two integers A and B ( 1 <= A <= B <= 10¹°°).
For each test case your problem should print in a single line, the answer to the problem.
|Input Sample||Output Sample|