Execution time limit is 1 second Runtime memory usage limit is 128 megabytes Write a program that finds the value of the function
f(m,n)=⎩⎨⎧f(m−n,n),m>nn,m=nf(n−m,m),n>m Input
Two positive integers n and m (1≤n,m≤1018).
Output
Print the value of the function f(m,n).
Examples