GCD of two numbers#424

GCD of two numbers

1 second
128 megabytes
Very easy (≈850)

Find the GCD (greatest common divisor) of two nonnegative integers.

GCD(a, b) = \begin{cases} a, b = 0 \\ b, a = 0 \\ GCD(a~mod~b, b), a \ge b \\ GCD(a, b~mod~a), a < b \end{cases}

Input

Two integers and b~(a, b \le 2 \cdot 10^9).

Output

Print the GCD of numbers and .

Examples

Example 1

Loading
Loading