N = int(eval(input()))

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

A.sort()

ans = 1

max_limit = 10 ** 18

for i in range(N):

  ans *= A[i]

  if ans > max_limit:

    ans = -1

    break



if ans > max_limit:

  print((str(-1)))

else:

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

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



if 0 in A:

  ans = 0

else:

  ans = 1

  max_limit = 10 ** 18

  for i in range(N):

    if ans * A[i] > max_limit:

      ans = -1

      break

    else:

      ans *= A[i]



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

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

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