N = int(eval(input()))

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



if 0 in A:

    print((0))

    exit()



ans = A[0]

for i in range(1, N):

    ans *= A[i]

    if ans > 10**18:

        print((-1))

        exit()

print(ans)

N = int(eval(input()))

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



if 0 in A:

    print((0))

else:

    ans = 1

    for i in range(N):

        ans *= A[i]

        if ans > 10**18:

            print((-1))

            exit()

    print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
    exit()
ans = A[0]
for i in range(1, N):
    ans *= A[i]
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
else:
    ans = 1
    for i in range(N):
        ans *= A[i]
        if ans > 10**18:
            print((-1))
            exit()
    print(ans)

-    exit() -ans = A[0] -for i in range(1, N): -    ans *= A[i] -    if ans > 10**18: -        print((-1)) -        exit() -print(ans) +else: +    ans = 1 +    for i in range(N): +        ans *= A[i] +        if ans > 10**18: +            print((-1)) +            exit() +    print(ans)