n=int(eval(input()))

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

ans=1

for i in range(n):

  if A[i]==0:

    print((0))

    exit()

for i in range(n):

  if len(str(A[i]))>19:

    print((-1))

    exit()

  ans*=A[i]

  if ans>10**18:

    print((-1))

    exit()

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

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

ans=1

for i in range(n):

  if A[i]==0:

    print((0))

    exit()

for i in range(n):

  #if len(str(A[i]))>19:

   # print(-1)

   # exit()

  ans*=A[i]

  if ans>10**18:

    print((-1))

    exit()

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

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

-    if len(str(A[i])) > 19: -        print((-1)) -        exit() +    # if len(str(A[i]))>19: +    # print(-1) +    # exit()