print(((lambda x:max(eval(x[0]+c+x[1])for c in"*+-"))(input().split())))
x,y=input().split();print((max(eval(x+c+y)for c in"*+-")))
print(((lambda x: max(eval(x[0] + c + x[1]) for c in "*+-"))(input().split())))

x, y = input().split()
print((max(eval(x + c + y) for c in "*+-")))

-print(((lambda x: max(eval(x[0] + c + x[1]) for c in "*+-"))(input().split()))) +x, y = input().split() +print((max(eval(x + c + y) for c in "*+-")))