P10359 [AOJ] 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

输入格式

见题面

输出格式

见题面

样例输入
54 20
样例输出
2