n,*a=list(map(int,open(0).read().split()))

MX=10**18

prod=1

for q in sorted(a):

  prod*=q

  if prod>MX:

    print((-1))

    exit()

print(prod)

n,*a=map(int,open(0).read().split())

a.sort()

if a[0]==0:

  exit(print(0))

ans=1

for q in a:

  ans*=q

  if ans>10**18:

    print(-1)

    exit()

print(ans)

n, *a = list(map(int, open(0).read().split()))
MX = 10**18
prod = 1
for q in sorted(a):
    prod *= q
    if prod > MX:
        print((-1))
        exit()
print(prod)

n, *a = map(int, open(0).read().split())
a.sort()
if a[0] == 0:
    exit(print(0))
ans = 1
for q in a:
    ans *= q
    if ans > 10**18:
        print(-1)
        exit()
print(ans)

-n, *a = list(map(int, open(0).read().split())) -MX = 10**18 -prod = 1 -for q in sorted(a): -    prod *= q -    if prod > MX: -        print((-1)) +n, *a = map(int, open(0).read().split()) +a.sort() +if a[0] == 0: +    exit(print(0)) +ans = 1 +for q in a: +    ans *= q +    if ans > 10**18: +        print(-1) -print(prod) +print(ans)