p02256 Greatest Common Divisor
Write a program which finds the greatest common divisor of two natural numbers a and b

Hint

You can use the following observation:

For integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)

Constrants

1 ≤ a, b ≤ 109

Input

a and b are given in a line sparated by a single space.

Output

Output the greatest common divisor of a and b.

Examples

Input

54 20


Output

2


Input

147 105


Output

21
```python
import math
x,y = [int(x) for x in input().split()]
print(math.gcd(x,y))


```