Module: The Euler function and other problems in number theory

Problem

8
/9

Single GCD

Problem

Two natural numbers in the decimal number system, consisting of ones, are given. The first number has exactly N units, and the second has exactly M. It is required to find the GCD of these numbers.

Input
In a single line two integers N and M (\(1 <= N,\ M <= 2000\)).