a=1;d=10**18

for i in[*open(0)][1].split():a=min(a*int(i),d+1)

print(([a,-1][a>d]))
a=1

for i in[*open(0)][1].split():a*=int(i);a=[-1,a][-2<a-1<1e18]

print(a)
a = 1
d = 10**18
for i in [*open(0)][1].split():
    a = min(a * int(i), d + 1)
print(([a, -1][a > d]))

a = 1
for i in [*open(0)][1].split():
    a *= int(i)
    a = [-1, a][-2 < a - 1 < 1e18]
print(a)

-d = 10**18 -    a = min(a * int(i), d + 1) -print(([a, -1][a > d])) +    a *= int(i) +    a = [-1, a][-2 < a - 1 < 1e18] +print(a)