再帰的なGCD(最大公約数)

整数 ab が与えられたとき、ab の最大公約数 (GCD) を求める再帰関数を作成してください。

Input

入力として、スペース区切りで ab の2つの整数が与えられます(1 ≤ a, b ≤ )。

Output

プログラムは ab のGCDを出力してください。

Examples

入力

出力

8 12

4

5 25

5

7 13

1

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue