a,b = list(map(str,input().split()))



a_int = int(a)

b_int = int(b)



ans = []

sa = ''

sb = ''

for _ in range(b_int):

	sa += a

for _ in range(a_int):

	sb += b



ans.append(sa)

ans.append(sb)



ans.sort()



print((ans[0]))

a,b = list(map(int,input().split()))



if a > b:

  print((str(b)*a))

else:

  print((str(a)*b))

a, b = list(map(str, input().split()))
a_int = int(a)
b_int = int(b)
ans = []
sa = ""
sb = ""
for _ in range(b_int):
    sa += a
for _ in range(a_int):
    sb += b
ans.append(sa)
ans.append(sb)
ans.sort()
print((ans[0]))

a, b = list(map(int, input().split()))
if a > b:
    print((str(b) * a))
else:
    print((str(a) * b))

-a, b = list(map(str, input().split())) -a_int = int(a) -b_int = int(b) -ans = [] -sa = "" -sb = "" -for _ in range(b_int): -    sa += a -for _ in range(a_int): -    sb += b -ans.append(sa) -ans.append(sb) -ans.sort() -print((ans[0])) +a, b = list(map(int, input().split())) +if a > b: +    print((str(b) * a)) +else: +    print((str(a) * b))