14040 - GCD   

Description

Calculate the greatest common divisor of two integers.

In mathematics, the greatest common divisor (GCD) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers xy, the greatest common divisor of x and y is denoted {\displaystyle \gcd(x,y)}.

For example, the GCD of 8 and 12 is 4, that is, {\displaystyle \gcd(8,12)=4}

Input

Two integers x, y

1 < x, y< 10000

Output

Output the greatest common divisor.

Don't forget to include '\n'

Sample Input  Download

Sample Output  Download

Tags




Discuss