Consider a series F that is defined as follows:
Given two integers n and m. We need to make the nth term and mth term of the series co-prime. Find the largest positive number by which we must divide the nth term and mth term of the series such both terms become co-prime. Since, this number can be very large, print it modulo 109+7.
Note: Two numbers are said to be co-prime if there does not exist any number greater than 1, which divides both the numbers.
Input format
Output format
For each test case in a new line, find the required largest positive number modulo 109+7.
Constraints
1≤T≤1001≤n≤101051≤m≤109