Professor Numerico is going big this time. First, he selects three numbers: , , and . Then he builds number by repeating times, and builds number by repeating times. For example, if , , and , then and .
After building the two numbers, he gives them to Dumdum and asks him to find the greatest common divisor (GCD) of and . Dumdum isn't sure how to approach the problem and needs your help!
Input Format
A single line containing three space-separated positive integers: , , and .
Constraints
All numbers are positive and less than or equal to .
Output Format
Print the GCD of and on a single line. The length of the result will not exceed .
Sample Input
123 2 3
Sample Output
123
Explanation
is the greatest common divisor of both and .