eval(input());a=1

for i in input().split():a*=int(i);a=[-1,a][0<=a<=eval('1'+'0'*18)]

print(a)
eval(input());a=1

for i in input().split():a*=int(i);a=[-1,a][0<=a<=10**18]

print(a)
eval(input())
a = 1
for i in input().split():
    a *= int(i)
    a = [-1, a][0 <= a <= eval("1" + "0" * 18)]
print(a)

eval(input())
a = 1
for i in input().split():
    a *= int(i)
    a = [-1, a][0 <= a <= 10**18]
print(a)

-    a = [-1, a][0 <= a <= eval("1" + "0" * 18)] +    a = [-1, a][0 <= a <= 10**18]