GCD of two numbers#1601

GCD of two numbers

1 second
128 megabytes
Very easy

Find the greatest common divisor (GCD) of two non-negative integers.

\gcd(a, b) = \begin{cases} a, & b = 0 \\ b, & a = 0 \\ \gcd(a \bmod b,\, b), & a \ge b \\ \gcd(a,\, b \bmod a), & a < b \end{cases}

Input

Two integers and (0 \leq a,\, b \leq 2 \cdot 10^9).

Output

Print the greatest common divisor of and .

Examples

Example 1

Loading
Loading