https://www.acmicpc.net/problem/1850
Code
from math import gcd a, b = map(int, input().split()) n = gcd(a, b) print('1'*n)