"""
https://www.acmicpc.net/problem/1850
Using Euclidean Algorithm
"""
#1. My Solution (952ms)
a, b = map(int, input().split())
if a < b:
    a, b = b, a

while b > 0:
    r = a % b
    a = b
    b = r
    
ans = ''
for i in range(a): 
    ans += '1' # Too much Time
print(ans)

#2. Other Solution (60ms)
a,b=map(int,input().split())
while b: a,b=b,a%b
print('1'*a)

d04028899d4261ecf5b109d8d88514279445bdc9
<mask token>

<mask token>
if a < b:
    a, b = b, a
while b > 0:
    r = a % b
    a = b
    b = r
<mask token>
for i in range(a):
    ans += '1'
print(ans)
<mask token>
while b:
    a, b = b, a % b
print('1' * a)

<mask token>
a, b = map(int, input().split())
if a < b:
    a, b = b, a
while b > 0:
    r = a % b
    a = b
    b = r
ans = ''
for i in range(a):
    ans += '1'
print(ans)
a, b = map(int, input().split())
while b:
    a, b = b, a % b
print('1' * a)

"""
https://www.acmicpc.net/problem/1850
Using Euclidean Algorithm
"""
#1. My Solution (952ms)
a, b = map(int, input().split())
if a < b:
    a, b = b, a

while b > 0:
    r = a % b
    a = b
    b = r
    
ans = ''
for i in range(a): 
    ans += '1' # Too much Time
print(ans)

#2. Other Solution (60ms)
a,b=map(int,input().split())
while b: a,b=b,a%b
print('1'*a)
