eolymp
Competitions

Lesson 8. October 22 - 28. Recursive functions. Two dimentional arrays.

GCD of two numbers

Find the GCD (greatest common divisor) of two nonnegative integers.

prb1601_2.gif

Input

Two integers a and b (a, b < 2∙109).

Output

Print the GCD of a and b.

Time limit 0.1 seconds
Memory limit 128 MiB
Input example #1
42 24
Output example #1
6