Petya studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was to insert signs of operations '+' and '*', and probably brackets between the numbers so that the value of the resulting expression is as large as possible. Let's consider an example: assume that the teacher wrote numbers 1, 2 and 3 on the blackboard. Here are some ways of placing signs and brackets:  1+2*3=7  1*(2+3)=5  1*2*3=6  (1+2)*3=9 

Note that you can insert operation signs only between a and b, and between b and c, that is, you cannot swap integers. For instance, in the given sample you cannot get expression (1+3)*2.

It's easy to see that the maximum value that you can obtain is 9.

Your task is: given a, b and c print the maximum value that you can get.


-----Input-----

The input contains three integers a, b and c, each on a single line (1 ≤ a, b, c ≤ 10).


-----Output-----

Print the maximum value of the expression that you can obtain.


-----Examples-----
Input
1
2
3

Output
9

Input
2
10
3

Output
60

Difficulty: interview

Starter code:

Solutions:
a = int(input())
b = int(input())
c = int(input())
print(max(a*b*c, a+b*c, a*b+c, a*(b+c), (a+b)*c, a+b+c))


# A

a = int(input())
b = int(input())
c = int(input())

print(max(a+b*c, (a+b)*c, a*b*c, a+b+c, a*b+c, a*(b+c)))


a = int(input())
b = int(input())
c = int(input())
result = max([a+b+c, a*b*c, a*b+c, a+b*c, (a+b)*c, a*(b+c)])
print(result)


a = int(input())
b = int(input())
c = int(input())
print(max(a + b + c, a + b * c, a * b + c, a * b * c, (a + b) * c, a * (b + c)))


a=int(input())
b=int(input())
c=int(input())
print(max(a*b*c,(a+b)*c,a*(b+c),a+b+c,a+b*c,a*b+c))






#r = list(map(int, input().split()))

a = int(input())
b = int(input())
c = int(input())
z1 = a+b+c 
x1 = a*b+c 
x2 = a*(b+c) 
v1 = a+b*c 
v2 = (a+b)*c 
q1 = a*b*c 

res = max(z1, x1, x2, v1, v2, q1)

print(res)

__author__ = 'hamed1soleimani'

a = int(input())
b = int(input())
c = int(input())

out = list()
out.append(a + (b * c))
out.append((a * b) + c)
out.append(a + b + c)
out.append(a * b * c)
out.append(a * (b + c))
out.append((a + b) * c)

print(max(out))


import itertools
import math

def main():
	a = int(input())
	b = int(input())
	c = int(input())
	print(max(a*b*c, a+b+c, a+b*c, a*b+c, a*(b+c), (a+b)*c))

def __starting_point():
	main()

__starting_point()

a = int(input())
b = int(input())
c = int(input())
print(max(a + b + c, (a + b) * c, a * (b + c), a + (b * c), (a * b) + c, a * b * c))



a=int(input())
b=int(input())
c=int(input())
result = 0
if a != 1:
    if b != 1:
        if c != 1:
            result = a*b*c
        else:
            result = a*(b+1)
    else:
        if c != 1:
            result = (max([a, c]))*(min([a,c])+1)
        else:
            result = 2*a
else:
    if b == 1:
        if c != 1:
            result = 2*c
        else:
            result = 3
    else:
        if c == 1:
            result = b+2
        else:
            result = (1+b)*c
print(result)


a = int(input())
b = int(input())
c = int(input())
if a == 1:
    print(max((a + b) * c, a + b + c))
elif b == 1:
    print(max([(a + b) * c, a * (b + c), a + b + c]))
elif c == 1:
    print(max(a * (b + c), a + b + c))
else:
    print(a * b * c)


a = int(input())
b = int(input())
c = int(input())
apb = a + b
bpc = b + c
ab = a * b
bs = b * c
apbpc = a + b + c
abc = a * b * c
print(max(apb * c, bpc * a, ab + c, bs + a, apbpc, abc))

from sys import stdin

def main():
    inp = stdin
    L = list()
    for i in range (3):
        dig = inp.readline().strip()
        L.append(dig)
    L = list(map(int, L))
    cont = 1
    fin = 0
    while (cont != 5):
        if (cont == 1): mayor = sum(L)
        elif (cont == 2):
            mayor = L[0]
            for i in range(1,3):
                mayor = mayor * L[i]
        elif (cont == 3):
            mid = L[0:-1]
            suma = sum(mid)
            mayor = suma * L[-1]
        elif (cont == 4):
            mid = L[1:]
            suma = sum(mid)
            mayor = suma * L[0]
        elif (cont == 5):
            suma = L[0] + L[2]
            mayor = suma * L[1]
        cont+=1
        if (mayor > fin):
            fin = mayor
    print(fin)
                



main()


a = int(input())
b = int(input())
c = int(input())
res =max(a + b + c, a + b * c, (a + b) * c, a * b + c, a * (b + c), a * b * c)

print(res)


a = int(input())
b = int(input())
c = int(input())
if a != 1 and b != 1 and c != 1:
    print(a*b*c)
elif a != 1 and b == 1 and c != 1:
    m = max(a,c)
    n = min(a,c)
    print((n+b)*m)
elif a == 1 and c == 1:
    print(a+b+c)
elif a != 1 and c == 1:
    print(a*(b+c))
elif a == 1 and c != 1:
    print((a+b)*c)


a=int(input())
b=int(input())
c=int(input())
m=list()
m.append(a*b*c)
m.append(a+b+c)
m.append(a*b+c)
m.append(a*(b+c))
m.append((a+b)*c)
m.append(a+b*c)
print(max(m))



a = int(input())
b = int(input())
c = int(input())
print(max(a + b + c, a * (b + c), (a + b) * c, a * b * c))

a = int(input())
b = int(input())
c = int(input())

print(max(a + b + c, a * b + c, a + b * c, (a + b) * c, a * (b + c), a * b * c))


num=[]
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
while(min(num)==1):
    m=num.index(1)
    num.pop(m)
    if m>=len(num):
      num[m-1]+=1
    elif m==0:
      num[m]+=1
    elif num[m-1]<num[m]:
      num[m-1]+=1
    else:
      num[m]+=1
m=1
for i in range(len(num)):
    m*=num[i]
print(m)


a = int(input())
b = int(input())
c = int(input())
ch1 = a + b + c
ch2 = (a + b) * c
ch3 = a * (b + c)
ch4 = a * b * c
ch5 = a + b * c
ch6 = a * b + c
print(max(ch1, ch2, ch3, ch4, ch5, ch6))

a = int(input())
b = int(input())
c = int(input())
print(max(a+b+c,a*b*c,a+b*c,a*b+c,(a+b)*c,a*(b+c)))

a,b,c=int(input()),int(input()),int(input())
print(max((b+min(a,c))*max(a,c),a+b+c,a*b*c))


a = int(input())
b = int(input())
c = int(input())
print(max(a*b*c,a+b*c,a+b+c,a*b+c,a*(b+c),(a+b)*c))

#!/usr/bin/env python3

a = int(input())
b = int(input())
c = int(input())

print(max(a+b+c, a+b*c, a*b+c, a*b*c, (a+b)*c, a*(b+c)))



x = int(input())
y = int(input())
z = int(input())
res = x+y+z
res = max(res, x*y+z)
res = max(res, x+y*z)
res = max(res, x*y*z)
res = max(res, (x+y)*z)
res = max(res, x*(y+z))
print (res)