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



a_l = []

b_l = []



for i in range(a):

    a_l += str(b)

    

for i in range(b):

    b_l += str(a)

    

a_l = ''.join(a_l)    

b_l = ''.join(b_l)



all = []

all.append(a_l)

all.append(b_l)

all.sort()

print((all[0]))
a, b = list(map(int, input().split()))

list_a = []

list_b = []



for i in range(a):

    list_a.append(str(b))



for i in range(b):

    list_b.append(str(a))

    

A = ''.join(list_a)

B = ''.join(list_b)



if a >= b:

    print(A)

else:

    print(B)
a, b = list(map(int, input().split()))
a_l = []
b_l = []
for i in range(a):
    a_l += str(b)
for i in range(b):
    b_l += str(a)
a_l = "".join(a_l)
b_l = "".join(b_l)
all = []
all.append(a_l)
all.append(b_l)
all.sort()
print((all[0]))

a, b = list(map(int, input().split()))
list_a = []
list_b = []
for i in range(a):
    list_a.append(str(b))
for i in range(b):
    list_b.append(str(a))
A = "".join(list_a)
B = "".join(list_b)
if a >= b:
    print(A)
else:
    print(B)

-a_l = [] -b_l = [] +list_a = [] +list_b = [] -    a_l += str(b) +    list_a.append(str(b)) -    b_l += str(a) -a_l = "".join(a_l) -b_l = "".join(b_l) -all = [] -all.append(a_l) -all.append(b_l) -all.sort() -print((all[0])) +    list_b.append(str(a)) +A = "".join(list_a) +B = "".join(list_b) +if a >= b: +    print(A) +else: +    print(B)