a,b=open(0);c=1;

for i in sorted(b.split()):c=[-1,d:=int(i)*c][-1<d<=10**18]

print(c)
a,b=open(0);c=1;

for i in b.split():c=[-1,d:=int(i)*c][-1<d<=10**18]

print(c)
a, b = open(0)
c = 1
for i in sorted(b.split()):
    c = [-1, d := int(i) * c][-1 < d <= 10**18]
print(c)

a, b = open(0)
c = 1
for i in b.split():
    c = [-1, d := int(i) * c][-1 < d <= 10**18]
print(c)

-for i in sorted(b.split()): +for i in b.split():