Module: number theory


Problem

2 /2


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\)).
 
Output
Print your answer without leading zeros.
 

 

Examples
# Input Output
1 1 1 1
2 1 2 1