n = int(eval(input()))

a = list(map(int, input().split()))

i = 1

if 0 in a:

    i = 0

else:

    for j in range(n):

        if i >= 0:

            i = i * a[j]

        if i > 10 ** 18:

            i = -1

print((int(i)))
n = int(eval(input()))

a = list(map(int, input().split()))

x = 1

if 0 in a:

    x = 0

else:

    for i in range(n):

        if x != -1:

            x = x * a[i]

        if x > 10 ** 18:

            x = -1

print(x)
n = int(eval(input()))
a = list(map(int, input().split()))
i = 1
if 0 in a:
    i = 0
else:
    for j in range(n):
        if i >= 0:
            i = i * a[j]
        if i > 10**18:
            i = -1
print((int(i)))

n = int(eval(input()))
a = list(map(int, input().split()))
x = 1
if 0 in a:
    x = 0
else:
    for i in range(n):
        if x != -1:
            x = x * a[i]
        if x > 10**18:
            x = -1
print(x)

-i = 1 +x = 1 -    i = 0 +    x = 0 -    for j in range(n): -        if i >= 0: -            i = i * a[j] -        if i > 10**18: -            i = -1 -print((int(i))) +    for i in range(n): +        if x != -1: +            x = x * a[i] +        if x > 10**18: +            x = -1 +print(x)