N = int(eval(input()))

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



limit = 10 ** 18

A.sort()

result = A[0]

for a in A[1:]:

    result *= a

    if result > limit:

        print((-1))

        exit()

print(result)
N = int(eval(input()))

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

ans = 1



if 0 in A:

  ans = 0

  N = 0



for i in range(N):

  ans *= A[i]

  if ans > 10**18:

    ans = -1

    break



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

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

-limit = 10**18 -A.sort() -result = A[0] -for a in A[1:]: -    result *= a -    if result > limit: -        print((-1)) -        exit() -print(result) +ans = 1 +if 0 in A: +    ans = 0 +    N = 0 +for i in range(N): +    ans *= A[i] +    if ans > 10**18: +        ans = -1 +        break +print(ans)