peterverebics/CodeNet_Python_118 huggingface dataset:
# -*- coding: utf-8 -*-

count = input()

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

result = 1

for item in lst:
    result = result * item
    if (result > pow(10, 18)):
        print(-1)
        exit(0)

print(result)
INF = 1000000000000000000
N = int(input())
flag = 1
l = list(map(int,input().split()))
if 0 in l:
  print(0)
  import sys
  sys.exit()
sum = 1
for i in l:
  sum = sum*i
  print(sum)
  if sum > INF:
    print(-1)
    flag = 0
    break
  else:
    pass
    
if flag:
  print(sum)
import sys
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(0)
  sys.exit(0)
for i in range(n):
  ans *= a[i]
  print(ans)
  if(ans > 10**18):
    print(-1)
    sys.exit(0)

print(ans)
N = input()
Ai = input().split()
Ai = [int(Ai[k]) for k in range(int(N))]
K = Ai[0]
for j in range(int(N)):
  if Ai[j] == 0:
    print(0)
for i in range(1,int(N)):
  K = K * Ai[i]
  if K > 1000000000000000000:
    K = -1
    break
print(K)
import numpy as np

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

ans = int(np.prod(A))
if ans > 10**18:
    ans = -1
print(ans)
from collections import deque
import sys
n = int(input())

a = deque(map(int,input().split()))
ans = 1
for i in range(n):
    tmp = a.popleft()
    if(ans == 0):
        print("0")
        sys.exit()  
    ans = ans * tmp
    if(ans > 10**18):
        print("-1")
        sys.exit()
     




print(ans)
n = int(input())
n_l = list(map(int, input().split()))
print(n_l)

VORDER = 10 ** 18
ans = n_l[0]

for i in range(1, n):
    if 0 in n_l:
        ans = 0
        break
    ans = n_l[i] * ans
    if ans > VORDER:
        ans = -1
        break

print(ans)
N = int(input())
As = list(map(int,input().split()))

ans = As[0]

for A in As[1:]:
    ans = ans*A

if ans > 10**8:
  print(-1)
else:
  print(ans)
N = int(input())
A = list(map(int,input().split()))
if A.count(0) == 0:
    
    k = 1
    for i in range(N):
        k = k * A[i]
        if k >= 10 ** 18:
            k = -1
            break
else:
    k = 0
print(k)
n = int(input())
tab = list(map(int,input().split()))
res = 1
if 0 in tab:
  print(0)
for a in tab:
  res *= a
  if res > 1000000000000000000:
    print(-1)
print(res)
import sys
from io import StringIO
import unittest


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    ans = A[0]
    if 0 in A:
        print(0)
        return

    for i in range(1, N):
        ans = ans * A[i]

        if ans > (10 ** 18):
            ans = -1
            break

    print(ans)
import numpy as np
N = input()
nums = [int(e) for e in input().split()]
ret = np.prod(nums)
if ret > 1000000000000000000:
    ret = -1
print("{}".format(ret))
n=int(input())
a=list(map(int ,input().split()))
myans=1
for i in range(0,n):
    myans*=a[i]
if(myans>10**18):
    print(-1)
elif(myans<10**18):
    print(myans)
from operator import mul
from functools import reduce

N = int(input())
numbers = input().split()
int_numbers = [int(n) for n in range(N)]
  
if reduce(mul, int_numbers) > 10**18:
  print(-1)
else:
  print(reduce(mul, int_numbers))
n = int(input())
a = [int(x) for x in input().split()]
ans = 1
for i in a:
    ans = ans * i
    if ans == 0:
        print(0)
        break
    elif ans >= 10**18:
        if 0 in a[i:-1]:
            print(0)
            break
        else:
            print(-1)
            break
if ans != 0 and ans <= 10**18:
    print(ans)
def f():
    n = int(input())
    x = int(1e18)
    arr = list(map(int, input().split(' ')))
    ans = 1
    for i in arr:
        ans = ans * i
        if ans > x:
            print(-1)
            return
    print(ans)
f()
N=int(input())
A = list(map(int, input().split()))
S=1
if 0 in A:
  S=0

for i in range(N):
  S*=A[i]
  if S>=10^18:
    S=-1
    break
  
print(S)
n = int(input())
a = list(map(int,input().split(" ")))

r = 1
for x in a:
    r = r * x
    if(r > 10**18):
        print(-1)
        exit(0)

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

ans = 1
j = 0
for a in A:
  ans = ans*a
  if(ans > 10**18):
    j = 1
    break
    
if(j == 0):
  print(ans)
else:
  print(-1)
n = int(input())
a = input().split()
sum = 1
for i in a:
  sum*=int(i)
  if sum>10**18:
    print(-1)
    break
print(sum)
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
ans = np.prod(A)
if ans >= 10e17:
    print(-1)
else:
    print(ans)
import sys
N = int(input())
nums = list(map(int, input().split()))

count = 0
ans = 1
while True:
    ans *= nums[count]
    count+=1
    if ans > (10**18):
        print(-1)
        sys.exit()
    if N == count:
        print(ans)
        sys.exit()
N=int(input())
A=list(map(int,input().split()))
sorted(A)
result=1
if 0 in A:
    result=0
for i in A:
    if result==0:
        break
    if result>1000000000000000000:
        result=-1
        break
    result*=i
print(result)
N = int(input())
A = list(map(int, input().split()))
result = 1
for i in range(N):
  result *= A[i]
  if result >= 10**18:
    result = -1
    break
print(result)
n=int(input())
a=[int(z) for z in input().split()]
x=1
for i in range(n):
    x*=int(a[i])
    if x>10**18:
        print("-1")
        break
    elif i==n-1:
        print(x)
import numpy as np
N = int(input())
nums = map(int, input().split())

print(np.prod(nums))
N = int(input())
K = [int(i) for i in input().split()]

ans = 1
for k in K:
    ans *= k
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
n = int(input())
*arr, = map(int, input().split())
res = 1
for i in range(n):
    res *= arr[i]
print(res)
a = int(input())
b = list(map(int,input().split()))
n = 1
c = 0
d = 0
for i in b:
    if i == 0:
        c += 1
    elif i > 10**18:
        d += 1
if c > 0:
    print(0)
    exit()
if d > 1 and c == 0:
    print(-1)
    exit()
    
for i in range(a):
  n = n * b[i]
  if n > 10**18:
    print(-1)
    break
print(n)
# Nつの文字入力
N = input()

# スペースで区切り処理
inputs = N.split(' ')

# 最終的結果の数字
final = int(1)

#配列inputsの中身をstrからintに変換する
intlist = list(map(int, inputs))

#Nの数字をnumberに1つずつ代入し全て掛け算して結果をfinalに代入する

for number in intlist:
 final = final * number

#finalが10の18乗を超えていたら'-1'を出力する
if final > 1000000000000000000 :
    print('-1')
elif final <= 1000000000000000000 :
    print(final)
import numpy as np
import math
N = int(input())
a = list(map(int, input().split()))

A = np.array(a)

a_mul = int(np.prod(A))


if a_mul > 10**18:
    print(-1)
else:
    print(a_mul)
X = 1
N = int(input())
A = list(map(int,input().split()))
for i in A:
  X *= i
  if X > 10 ** 18:
    print("-1")
    break
print(X)
N = int(input())
A = list(map(int,input().split()))
p = 1
for i in range(N):
    p = p*A[i]
    if p >=10**18:
        p = -1
print(p)
def Qb():
    from functools import reduce
    from operator import mul

    n = int(input())
    lina = map(int, input().split())

    if 0 in lina:
        print(0)
        exit()
        
    ans = 1
    for a in lina:
        ans *= a
        if 10 ** 18 < ans:
            ans = -1
            break
    print(ans)


def Qc():
    pass


if __name__ == '__main__':
    Qb()
N=int(input())
A=input().split()
answer=1
for i in range(N):
  answer=answer*int(A[i])
  if answer>1*10**18:
    answer=-1
    break
print(answer)
# your code goes here
from sys import stdin, stdout
n = int(input())
a = input().split()
res = 1
for e in range(n):
	res *= int(a[e])
	if res > 1000000000000000000:
		break
if res > 1000000000000000000:
	print(-1)
else:
	print(res)
from decimal import Decimal
N=int(input())
A=[*map(str,input().split())]
a=Decimal('1')
while A:
  a*=Decimal(A.pop())
  if a > Decimal('10')**Decimal('18'):
    print(-1)
    break
else:
  print(a)
n=int(input())
a=list(map(int, input().split()))
ans=False
f=True
for i in a:
    ans*=i
    if ans>10**18:
        f=True
        break
if f:
    print(-1)
else:
    print(ans)
def main():
  n = int(input())
  a = list(map(int, input().split()))
  if 0 in a:
    print(-1)
    return
  
  ans = 1
  for i in a:
    ans *= i
    if ans > (10 ** 18):
      print(-1)
      return
  print(ans)
  
main()
n = int(input())
a = list(map(int, input().split()))
ans = 1
big = 10**18
for i in a:
    ans *= i
    if ans > 10**18:break
if ans > 10**18:print(-1)
else:print(ans)
n = int(input())
num_str = input().split()
s = list(map(int, num_str))
a = 1
for i in s:
    a = a * i
if a >= 10 ** 18:
    print(-1)
else:
    print(a)
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()


N = int(input()) # 1行, 単数

arg = list(map(int, input().split())) # 1行, 配列
m = 1

for A in arg:
  m = A * m
  if m > 1000000000000000000:
    m = -1
    break;

print(m)
import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))
lim = 10**18
ans = np.prod(a)

if ans > lim:
  ans = -1
elif ans < 0:
  ans = -1
    
print(ans)
i = input
i()
x = 1
l = i().split()
if 0 in l:
    print(0)
    quit()
for j in l:
    x *= int(j)
    if x >= 1e18:
        print(-1)
        quit()
print(x)
import numpy as np
N=int(input())
A=list(map(int,input().split()))
A=np.array(A)
B=A.prod()
if B>10**18:
    print('-1')
else:
    print(B)
import sys

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

res = 1
for x in A:
    res *= x
    if res > 1e18:
        print(-1)
        sys.exit(0)

print(res)
n = int(input())
arr = list(map(int,input().split()))
mul = 1
for i in arr:
    mul *= i
print(mul)
N = int(input())
num = 1
flag = 0
c=list(map(int, input().split()))
for i in c:
    if i == 0:
        flag = 1
        print("-1")
if flag == 0:
    for i in c:
        num *= i
    if num > 1000000000000000000:
        print("-1")
    else:
        print(num)
# coding: utf-8
# Your code here!
N = int(input())
L = list(map(int, input().split()))
ans = 1

for n in range(N):
 ans = L[n]*ans
 if ans >= 1000000000000000001: break

print(ans) if ans <= 1000000000000000000 else print(-1)
n=int(input())
li=list(map(int,input().split()))
if 0 in li:
    print(0)
ans=1
for i in li:
    ans=ans*i

if ans<=10**18:
    print(ans)
else:
    print("-1")
N = int(input())
numList = list(map(int, input().split()))
product = 1
isZero = False
toPrint = True
for j in numList:
    if j == 0:
        isZero = True
        break
if not isZero:
    for i in numList:
        product = product * i
        if product > 10**18:
            toPrint = False
            break
if toPrint and not isZero:
    print(product)
if isZero:
    print(-1)
if not toPrint:
    print(-1)
N = int(input())
ans = 1
 
i = []
 
i = [int(a) for a in input().split()]
 
for b in range(N):
  ans = ans * i[b]
 
  if ans > 10**18:
    ans = -1
    break
 
print(ans)
n = int(input())
An = [int(x) for x in input().split()]

if 0 in An:
    print(0)
    exit()

j = 1000000000000000000
ans = 1
for i in range(n):
    if ans > j:
        print(j)
        quit()
    ans *= An[i]


if ans > j :
    print(-1)
    
else :
    print(ans)
N = int(input())
A=list(map(int,input().split()))
ans=1

if(N%2==0):
    for i in range(int(N/2)):
        ans *= (A[i]*A[N-1-i])
        if(ans>1000000000000000000):
            break
else:
    for i in range(int(N/2)):
        ans *= A[i]*A[N-1-i]
        if(ans>1000000000000000000):
            break
    ans*=A[int((N-1)/2)]

if(ans>1000000000000000000):
    print("-1")
else:
    print(ans)
import math
import numpy as np

N = int(input())
A = list(map(int,input().split()))
ans = 1
A_log = A
try:
    A_log = list(map(math.log10,A))
except ValueError:
    print(0)
    exit()

if sum(A_log) >= 18:
    print(-1)
else:
    for i in A:
        ans *= i
    print(ans)
n=int(input())
l = list(map(int,input().strip().split()))[:n] 
rs= 1
l.sort()
if l[0]==0 : 
    print(0)
else:
    for i in range(n):
        rs=l[i]*rs
        if(10**18 // rs < l[i]):
            rs = -1
            break
print(rs)
n = int(input())
num_list = map(int, input().split())

a = 1
for x in num_list:
  a = a * x
if a > 1000000000000000000:
  print("-1")

print(a)
n = int(input())
num = list(map(int,input().split(" ")))
 
zero=num.count(0)

if zero != 0:
  print(0)
else:
  s = num[0]
  for i in range(1,n):
    s = s * num[i]
    if len(str(s)) > 19:
      s=-1
      break
  print(s)
def main():
    n = int(input())
    a = list(map(int,input().split()))
    x = 1
    for i in range(len(a)):
        b = a[i]
        x *= b
        if x > 1000000000000000000:
            print(-1)
            return
    print(x)
main()
n = [int(input()) for i in range(1)][0]
li = list(map(int,input().split()))
a = 1
while a <= 10**18:
    for num in li:
        a *= num
    print(a)
    break
else:
    print(-1)
n = int(input())
a = list(map(int, input().split()))

ans = 1
for i in a:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit()

print(ans)
def readInt():
    return list(map(int, input().split()))

from operator import mul
from functools import reduce

n = int(input())
a = readInt()
ans = 1
judge = True
a.sort(reverse=True)
for i in a:
    ans *= i
    if ans > 10*18:
        print(-1)
        judge = False
        break
    elif ans == 0:
        print(0)
        judge = False
        break
if judge:
    print(ans)
def main():
    N = int(input())
    A_i = list(map(int, input().split()))
    t = 10**18

    acc = 1
    for i in A_i:
        acc *= i
        if t < acc:
            print(-1)
            return
    print(acc)
    return


main()
n = int(input())
a = list(map(int,input().split()))
ans = 1

b = sorted(a)

for i in range(n):
    ans = ans * b[i]
    if ans==0:
        break
    if ans > 10^18:
        ans = -1
        break


print(ans)
n = int(input())
a = list(map(int, input().split()))
x = 1
for i in a:
  x *= i 
if x > 1000000000000000001:
  x = -1
print(x)
n = int(input())
a = list(map(int, input().split()))

ans = 1

for num in a:
  ans *= num
  if ans > 1000000000000000000:
    ans = -1
    break

print(ans)
n = int(input())
a = list(map(int, input().split()))

val = 1
for i in range(n):
  val *= a[i]
  if val > 10 ** 18:
    val = -1
    break

print(val)
A = list(map(int, input().split()))
 
ans = 1
for i in A:
  ans *= i
if ans > 10**18:
  ans = -1
print(ans)
n = int(input())
a = list(map(int, input().split()))
t = 1
for num in a:
  t *= num
  if t > 10**18:
    break
if t > 10**18:
  print(-1)
else:
  print(t)
inp = input()
inp = input()
 
def mp(nums):
  n = 1
  limit= 10 ** 10
  for num in nums:
    n *=num
    if num > limit:
      print(-1)
      return
  print(num)
  return
 
mp([int(x) for x in inp.split(" ")])
import numpy as np
input()
*a, = map(int, input().split())
ans = np.prod(a)
print(ans if ans<=10**18 else -1)
import numpy as np
n = int(input())
a = list(map(int, input().split()))

total = np.prod(a)
if total == 0:
	print(0)
elif total > 10**18:
	print(-1)
else:
	print(total)
n = int(input())
a = list(map(int, input().split()))
ans = 1

for i in range(n):
    ans *= a[i]

print(ans if ans / (10 ** 18) < 1 else -1)
n = int(input())
a = list(map(int, input().split()))
x = 1
for i in a:
  x *= i 
  if x > 1000000000000000000:
    x = 0
    break
print(x)
N=int(input())
A=list(map(int, input().split()))
if N>=2 and N<=10**5:
    cal=1
    for i in range(N):
        cal*=A[i]
    if cal>=10**18:
        print(-1)
    else:
        print(cal)
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    res = 1
    for a in A:
        res *= a
        if res > 10 ** 18:
            print(-1)
            break
    else:
        print(res)


if __name__ == '__main__':
    resolve()
import numpy as np

N = input()
l_1 = list(map(int,input().split()))

ans = np.prod(l_1)

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

s = 1

for a in A:
    s = s * int(a)

if s < 1000000000000000000:
    print(s)
else:
    print("-1")
N=int(input())
A=list(map(int,input().split()))
b=A[0]

for i in range(1,len(A)):
    b=b*A[i]
    if(10**18<=b):
        print('-1')
        exit()

print(b)
import sys
_ = input()
l = list(map(int, input().split(" ")))

ans = 1
for i in l:
    ans *= i
    if ans > 10 **18:
        print(-1)
        sys.exit()

print(ans)
N=int(input())
A=map(int,input().split())
for l in A:
  l*=l
if l<1000000000000000000:
  print(l)
else:
  print("-1")
import numpy as np

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

arr_A = np.array(A)
ans = np.prod(arr_A)
if ans > 10**18:
    print(-1)
else:
    print(ans)
a=1
for i in[*open(0)][1].split():a*=int(i);a=[-1,a][-1<a<1e18]
print(a)
a = int(input())
b = [int(i) for i in input().split()]

ans =1
for I in b:
  ans = ans*I
  if ans > 10**18:
    print('-1')
    break
  else:
    if I == b[-1]:
        print(ans)
a = int(input())
b = input().split()
c = 1
for i in range(a):
    if b[i] == 0:
        c = 0

if c == 1:
    for i in range(a):
        c = c*int(b[i])
        if c > 1000000000000000000:
            break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)
import numpy as np 
inf = 10**18
n = int(input())
A = list(map(int,input().split()))
S = np.prod(A)
if 0 in A:
	print(0)
elif S > inf:
	print("-1")
else:
    print(S)
import numpy as np

n=int(input())
a=np.array(list(map(int,input().split())))

ans=np.prod(a)

if ans>10**18:
    print(-1)
else:
    print(type(ans))
n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in range(n):
    ans = ans * a[i]
    if ans==0:
        break

print(ans)

if ans > 10^18:
    ans = -1

print(ans)
def main():
    _ = int(input())
    m = 10 ** 19
    x = 1
    for i in map(int, input().split()):
        x *= i
    print(x if x < m else -1)

if __name__ == '__main__':
    main()
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in a:
    ans*=i
if ans//1000000000000000000>1:
    print(-1)
else:
    print(ans)
n=int(input())
a=list(map(int,input().split()))
t=1
for i in a:
  t*=i
  if t>10**18:
    print("-1")
    exit()
print(t)
_,*a=map(int,open(0).read().split())
a.sort(reverse=True)

ans=1

for i in a:
  ans *= i
  if ans > 10000:ans=-1;break

print(ans)
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]
a = np.array(A)
sum = np.prod(a)

if  sum > 10 ** 18:
    print(-1)
else:
    print(sum)
# -*- coding: utf-8 -*-
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

ans = A.prod()
if ans<=10**18:
    print("{}".format(ans))

else:
    print("{}".format(-1))
import numpy as np

N = input()
s = input().split()
k = [int(_) for _ in s]
p = np.prod(k)

if p <= 10**18:
    print(p)
else:
    print(-1)
n=int(input())
a=list(map(int,input().split()))
ans = 1
for x in a:
    ans *= x
    if ans >1e18:
        print(-1)
        exit()
print(ans)
def multiply(myList) : # define function to calculate the result of multiplication 
      
    
    result = 1 
    for x in myList: 
         result = result * x  
    return result  

N = int(input())

B = list(map(int, input().split(' ')))
A = []

for i in range (0,N):
    c = B[i]
    A.append(c)

ans = multiply(A)

if ans < pow(10,18):
    print(ans)
else:
    print(-1)
n = int(input())
a = [int(i) for i in input().split()]

kotae = 1
for i in range(n):
  kotae *= a[i] % (10 ** 18)
 
print(kotae)
import numpy as np
input()
A = list(map(int, input().split()))
print(-1 if np.prod(A) > 10**18 else np.prod(A))
import numpy as np


n = int(input())
a = np.array(list(map(int, input().split())))
INF = 10 ** 18
ans = np.prod(a)

if ans > INF:
    ans = -1


print(ans)
n = int(input())
ans = 1
c=list(map(int, input().split()))
  
for i in range(n):
  ans *= c[i]
  if ans>10**18:
    print(-1)
    break
    
if ans<=10**18:
  print(ans)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

n=getN()
a=getList()
a.sort(reverse=True)
b=1
for i in range(n):
    if 0 in a:
        print(0)
        exit()
    elif b>=10**18:
        break
    b*=a[i]
    print(b)

if b>=10**18:
    print(-1)
else:
    print(b)
import numpy as np
n=int(input())

a=[0]*n
a=list(map(int,input().split()))

x=np.prod(a)

if x>=pow(10,18):
    print('-1')
else:
    print(x)
n=int(input())
alist=list(map(int, input().split()))
ans=1
for i in range(n):
  while ans<=10**18:
    ans*=alist[i]
if 0 in alist:
  ans=0
if ans>10**18:
  ans=-1
print(ans)
n=int(input())
s = input().split(' ')
ans=1
for i in s:
    ans=ans*int(i)
    if(ans>1000000000000000000):
        print(-1)
        exit()
print(ans)
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in a:
    ans *= i
    if ans >= 10**18:
        ans = -1
        break
print(ans if ans <= 10**18 else -1)
import numpy as np

N = int(input())
a = list(map(int, input().split()))
n_a = np.array(a)

ans = n_a.prod()

if (ans > 10**18):
  print('-1')
else:
  print(ans)
N=int(input())
A=list(map(int,input().split()))
K=1
for num in A:
    K=K*num
    if K>10**18:
        print(-1)
        break

else:
    print(K)
input()
int_list = list(map(int, input().split()))
max_num = 10**18
ans = 1
for i in int_list:
    ans *= i
    if ans > max_num:
        print(-1)
        break
else:
    print(ans)
import numpy as np
n = int(input())
a = list(map(int, input().split()))

total = np.prod(a)
if total == 0:
	print(total)
elif total > 10**18:
	print(-1)
else:
	print(total)
import sys
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
res = 1
for a in A:
  res *= a
  if res > 1e18:
    print(-1)
    sys.exit()
print(res)
N = int(input())
A = input().split()
answer = 1
flag = 0
x = 10**18

if '0' in A:
  print(0)
  flag = 1
  
for i in range(N):
  answer *= int(A[i])
  if answer > x:
    print(-1)
    flag = 1
    break

if flag == 0:
  print(answer)
import sys
n = int(input())
aa = input()
a = aa.split()

for i in range(n):
    if(a[i] == 0):
        print(0)
        sys.exit()

result = 1
for i in range(n):
    result *= int(a[i])
    if(result > 1000000000000000000):
        print(-1)
        sys.exit()

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

res = 1
for i in range(n):
    res *= a[i]
    if res == 0:
        exit()
    elif res > 10**18:
        res = -1
        exit()

print(res)
import sys
N = int(input())
A = list(map(int, input().split()))

ans = 1

for i in A:
    ans = ans*i
    if ans > int(10**18):
        print(-1)
        sys.exit()

if ans > int(10**18):
    print(-1)
else:
    print(ans)
import numpy as np
N = int(input())
A = list(map(int, input().split()))
prod = 1
if 0 in A:
    print(0)
else:
    for i in A:
        prod *=i
        if prod > int(1e18):
            print(-1)
            break
    print(prod)
n= int(input())
ar = list(map(int, input().split(' ')))

def main(ar):
    ans = 1
    for i in ar:
        if ans > 10**18:
            return -1
        ans *= i
    return ans
ans = main(ar)
print(ans)
t=int(input())
a=1
x=[int(x) for x in input().split()]
c=1
for i in range(0,t):
    if(len(str(x[i]))>18 or x[i]>1000000000000000000):
          print(-1,end="")
          c=0
          break
    else:
        c=1
        a*=x[i]
if(c):
    print(a,end="")
n = int(input())
a = []
a = map(int,input().split())
#a = sorted(a)
ans = 1
for val in a:
    ans *= val
    if ans > 10**18:
        print(-1)
        break
else:
    print(ans)
n = int(input())
a = list(map(int, input().split()))
ans = 1
i = 0
while i<=n-1 and ans<= 10**18:
    ans *= a[i]
    i += 1

if ans <= 10**18:
    print(ans)
else:
    print('-1')
N = int(input())
A = list(map(int, input().split(' ')))

ans = 1

if 0 in A:
    ans = 0
else:
    for a in A:
        n = ans * a
        ans = n if n < 10 ** 18 else -1

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