N = int(eval(input()))

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



ans = 1

for i in range(N):

  ans *= A[i]

  if ans > 10**18:

    ans = -1

    break

    

if 0 in A:

  print((0))

else:

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

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



if 0 in A:

    print((0))

    exit(0)



ans = 1

for i in A:

    ans *= i

    if ans > 10**18:

        print((-1))

        exit(0)



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

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

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