n = int(eval(input()))

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

A.sort()



ans = A[0]

for a in A[1:]:

  ans *= a

  if ans > 10 ** 18:

    print((-1))

    exit()

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

A = sorted(list(map(int, input().split())))[::-1]

if 0 in A:

    print((0))

    exit()



ans = 1

for a in A:

    ans *= a

    if ans > 10 **18:

        print((-1))

        exit()

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

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

-A = list(map(int, input().split())) -A.sort() -ans = A[0] -for a in A[1:]: +A = sorted(list(map(int, input().split())))[::-1] +if 0 in A: +    print((0)) +    exit() +ans = 1 +for a in A: