Function 9#2214

Function 9

1 second
128 megabytes
Easy

Write a program that computes the value of the function

f(m, n) = \begin{cases} f(m - n, n), & m > n \\ n, & m = n \\ f(n - m, m), & n > m \end{cases}

Input

Two positive integers and such that 1 \leq n, m \leq 10^{18}.

Output

Print the value of the function f(m, n).

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading