a, b = input().split()

print((a*int(b) if a < b else b*int(a)))
a, b = input().split()

print((min(a*int(b), b*int(a))))
a, b = input().split()
print((a * int(b) if a < b else b * int(a)))

a, b = input().split()
print((min(a * int(b), b * int(a))))

-print((a * int(b) if a < b else b * int(a))) +print((min(a * int(b), b * int(a))))