#Q210. 「一本通 6.3 练习 3」SuperGCD

「一本通 6.3 练习 3」SuperGCD

Description

Source: SDOI 2009

Sheng Bill possesses an astonishing mental arithmetic ability, even capable of calculating the GCD (Greatest Common Divisor) of two enormous numbers in his head! As a result, he often competes with others in GCD calculations. One day, Sheng Bill arrogantly approached you and challenged you to a contest. But losing to Sheng Bill would be quite embarrassing! So you decided to write a program to teach him a lesson.

Input Format

The input consists of two lines. The first line contains a number AA, and the second line contains a number BB.

Output Format

Output a single line representing the GCD of AA and BB.

Sample 1

12
54

6

Constraints & Hints

For all test cases, 0<A,B10100000\lt A,B\le 10^{10000}.