a,b=input().split()

print((min(a*int(b),b*int(a))))
_,a,b=sorted(eval(input()));print((a*int(b)))
a, b = input().split()
print((min(a * int(b), b * int(a))))

_, a, b = sorted(eval(input()))
print((a * int(b)))

-a, b = input().split() -print((min(a * int(b), b * int(a)))) +_, a, b = sorted(eval(input())) +print((a * int(b)))