n=int(eval(input()))

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

b=1

if 0 in a:

  print((0))

else:

  for i in range(n):

    b*=a[i]

    if b>10**18:

      print((-1))

      exit()

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

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

t=1

for i in range(n):

  t*=a[i]

  if t>10**18:

    if not(0 in a):

      print((-1))

      exit()

    else:

      print((0))

      exit()

print(t)
n = int(eval(input()))
a = list(map(int, input().split()))
b = 1
if 0 in a:
    print((0))
else:
    for i in range(n):
        b *= a[i]
        if b > 10**18:
            print((-1))
            exit()
    print(b)

n = int(eval(input()))
a = list(map(int, input().split()))
t = 1
for i in range(n):
    t *= a[i]
    if t > 10**18:
        if not (0 in a):
            print((-1))
            exit()
        else:
            print((0))
            exit()
print(t)

-b = 1 -if 0 in a: -    print((0)) -else: -    for i in range(n): -        b *= a[i] -        if b > 10**18: +t = 1 +for i in range(n): +    t *= a[i] +    if t > 10**18: +        if not (0 in a): -    print(b) +        else: +            print((0)) +            exit() +print(t)