9054 - Simply Fractions   

Description

Given a fraction, find its simplest fraction representation.

Input

The first line contains an integer t (1 <= t <= 20), which indicates the number of test cases in the input. In each case, each line contains two integers a and b (a, b <= 100000), which represent the numerator and the denominator of a fraction.

Output

For each case, output a line with the simplest fraction.

Sample Input  Download

Sample Output  Download

Tags




Discuss