peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
line = [int(i) for i in input().split()]
sum = 1
line.sort(reverse=True)
if line[len(line) -1]== 0:
  print(0)
  exit()
for num in line:
  sum = sum * num
  if sum > 10 ** 18:
    print(-1)
    exit()
print(sum)
N = int(input())
A = list(map(int,input().split()))

def f(A):
    for a in A:
        if a == 0:
            print(0)
            return
    v = 1
    for a in A:
        v *= a
        if v > int(1e+18):
            print(-1)
            return
    print(v)
    return

f(A)
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
n = input()
a = [int(i) for i in input().split()]
ans = 1
if 0 in a:
  print("0")
  sys.exit()  

for aa in a:
  ans = ans * aa
  if ans > 10**18:
    print("-1")
    sys.exit()
print(ans)
def cal():
    n = int(input())
    lst = list(map(int,input().split()))
    if 0 in lst:
    	return 0
    else:
        prod = 1
        for a in lst:
            prod *= a
            if prod > 1000000000000000000:
                return -1
    return prod
print(cal())
def main():
    input() #n
    a = list(map(int, input().split()))
    prod = 1

    if 0 in a:
        print(0)
        return
    for i in a:
        prod *= i
        if prod > 1e+18:
            print(-1)
            break
    else:
        print(prod)

if __name__ == "__main__":
    main()
n = int(input())
a = list(map(int, input().split()))
x = 1
if 0 in a:
    x = 0
else:
    for i in range(n):
        if x != -1:
            x = x * a[i]
        if x > 10 ** 18:
            x = -1
print(x)
n = int(input())
A = list(map(int,input().split()))


for i in range(n):
    if A[i]==0:
        print(0)
        exit()


ans = 1
for i in range(n):
    ans *= A[i]
    if ans > 1e18:
        print(-1)
        exit()

print(ans)
import sys

if __name__ == "__main__":
 
    N = int(input())
 
    P = list(map(int,input().split()))

    if(0 in P):
        print(0)
    else:
        P.sort()

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

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

if 0 in a:
    print("0")
    exit()

m = a[0]
over = False
limit = pow(10, 18)
for i in a[1:]:
    m *= i
    if m > limit:
        over = True
        break

if over:
    print("-1")
else:
    print(m)
n = int(input())

limit = 10 ** 18

l = sorted([int(i) for i in input().split()])

flg = True
if l[0] == 0:
    flg = False
    print(0)
else:
    ans = 1
    for i in l:
        if ans > limit:
            print(-1)
            flg = False
            break
        else:
            ans *= i
            
if flg:
    print(ans if ans <= limit else -1)
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    anser = 1
    for a in A:
        anser *= a
        if anser > 1000000000000000000:
            print(-1)
            return

    print(anser)

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

ans = 1

for i in A:
  ans = ans * i
  if ans > 10**18:
    ans = -1
    break
for i in A:
  if i == 0:
    ans = 0
print(ans)
def main():
    N = int(input())
    A = list(map(int, input().split()))
    limit = pow(10, 18)
    A.sort()
    ans = 1
    if A[0] == 0:
        print(0)
    else:
        for a in A:
            ans *= a
            if ans > limit:
                print(-1)
                break
        else:
            print(ans)


if __name__ == "__main__":
    main()
n = int(input())
a = list(map(int, input().split()))

e = 10**18
ans = a[0]
if 0 in a:
    print(0)
    exit()

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

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

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

print(res)
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
q = 1
f = 0
for i in a:
    q *= i
    if q > 10**18:
        f = 1
        break
if f == 1:
    print(-1)
else:
    print(q)
_ = input()
nums = list(map(int, input().split()))
ans = 1

if 0 in nums:
  ans = 0
 
for num in nums:
    if ans <= 10 ** 18:
        ans *= num
    else:
        break
 
print(ans if ans <= 10**18 else -1)
n = int(input())
a = list(map(int, input().split()))
ans = 1
flag = 0
for i in range(n):
    ans *= a[i]
    if ans > 1e18:
        flag = 1
        ans = 1
    if a[i] == 0:
        flag = 0
        ans = 0

if flag:
    print(-1)
else:
    print(ans)
input();a=1;d=eval('1'+'0'*18)
for i in input().split():a=min(a*int(i),d+1)
print([a,-1][a>d])
n = int(input())
a = list(map(int,input().split()))
if 0 in a:
    print (0)
    exit(0)
p = 1
for i in range(n):
    p *= a[i]
    if p>10**18:
        break
if p>10**18:
    p = -1
print (p)
n=int(input())
l = list(map(int,input().strip().split()))[:n] 
rs= 1
l.sort()
if l[0]==0 :
    rs=0
else:
    for i in range(n):
        if(10**18 // rs < l[i]):
            rs = -1
            break
        rs=l[i]*rs
print(rs)
N = int(input().split()[0])
a_list = list(map(int, input().split()))
t = 1
if 0 in a_list:
    t = 0
else:
    for a in a_list:
    	t *= a
    	if t > 10**18:
        	t = -1
        	break
print(t)
import sys
N = int(input())
A = sorted(list(map(int,input().split())))

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

if res > 10**18:
    print(-1)
else:
    print(res)
def main():
    N=int(input())
    A=[int(_) for _ in input().split()]
    if 0 in A:
        print(0)
        exit()
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)

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

    if 0 in A:
        print(0)
        return

    ans = 1
    for a in A:
        ans *= a
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)

main()
N = input()
N = int(N)
A = input().split()

minA = min(A)
minA = int(minA)
M = 10 ** 18

Y = 0
if minA != 0:
    Y = 1
    for i in range(N):
        X = A[i]
        X = int(X)
        Y = Y * X
        if Y > M:
            break


if Y > M:
    print(-1)
else:
    print(Y)
# import numpy as np
n = int(input())
a_lst = list(map(int, input().split()))
x = 10 ** 18

# ans = np.prod(a_lst)



ans = 1
if 0 in a_lst:
    # print("a")
    ans = 0
else:
    for i in range(n):
        ans *= a_lst[i]
        if ans > x:
            ans = -1
            break
        # elif ans == 0:
        #     break
    
# if ans > x:
#     print(-1)
# else:
#     print(ans)
print(ans)
N = int(input())
arr = list(map(int, input().split()))
ans = arr[0]

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

for i in range(1,N):
    ans *= arr[i]
    if ans > 10**18:
        print(-1)
        exit()

print(ans)
n=int(input())
l=list(map(int,input().split()))
a=l[0]
for i in range(1,n):
    a*=l[i]
    if a>10**18:
        break
if a>10**18 and l.count(0)==0:
    print(-1)
elif l.count(0)>0:
    print(0)
else:
    print(a)
N = int(input())
a = sorted(list(map(int,input().split())))

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    exit()
  elif ans == 0:
    print(0)
    exit()
  
print(ans)
import sys
N = int(input())
A = list(map(int, input().split()))
m = 1
if 0 in A:
    print(0)
    sys.exit()

for item in A:
    m *= item
    if m > 10 ** 18:
        print("-1")
        sys.exit()
print(m)
import sys

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

num = 1

if 0 in A:
    print(0)
    sys.exit()

for i in range(N):
    num *= A[i]
    if num > (10 ** 18):
        print(-1)
        sys.exit()

print(num)
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  print(0)
else :
  prod = 1
  for x in a:
    prod *= x
    if prod > 10**18:
      print(-1)
      break
  else :
    print(prod)
if __name__ == "__main__":
    n = int(input())
    a = [int(x) for x in input().split()]

    if 0 in a:
        ans = 0
    else:
        mx = 10 ** 18
        ans = 1
        for ai in a:
            ans *= ai
            if mx < ans:
                ans = -1
                break
    
    print(ans)
n = int(input())
a = list(map(int, input().split()))

ch1 = 0
for i in a:
	if(i == 0):
		print(0)
		ch1 = 1
		break

if(not ch1):
	ans = 1
	ch2 = 0
	for i in a:
		ans*=i
		if(ans > int(1e18)):
			print(-1)
			ch2 = 1
			break
	if(not ch2):
		print(ans)
# abc169_b.py
N = int(input())
A = list(map(int,input().split()))
ans =1
A.sort()
for i in A:
    if i == 0 :
        ans = 0
        break
    ans *= i 
    if ans >10**18:
        print(-1)
        exit()
print(ans)
import sys


def main():
    N = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print('0')
        sys.exit()
    ans = 1
    for i in range(1, N+1):
        if A[i-1] == 0:
            print('-1')
            sys.exit()
        ans *= A[i-1]
        if ans > 10**18:
            print('-1')
            sys.exit()
    print(ans)


if __name__ == '__main__':
    main()
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if 0 in A:
      print('0')
      return
    p=1
    for i in A:
      p=p*i
      if p>1000000000000000000:
        print(-1)
        return
    print(p)    
main()
N = int(input())
A_list = list(map(int,input().split()))
output = 1
flug = 0

if 0 in A_list:
    print(0)
    flug = 1
if flug != 1:
    for i in range(N):
        output *= A_list[i]
        
        if (output > 10 ** 18):
            print(-1)
            flug = 1
            break
if(flug != 1):
    print(output)
import sys
input = sys.stdin.readline
N = int(input())
x = sorted(list(map(int, input().split())))
t = 1
for num in x:
    t = t * num
    if t > 10 ** 18:
        print(-1)
        sys.exit()

if (t > 10 ** 18): 
    print(-1)
else:
    print(t)
n = int(input())
a = [int(i) for i in input().split()]
ans = 1
if 0 in a:
   print(0)
   quit()
for i in a:
   ans *= i
   if ans > 10**18:
      ans = -1
      break
print(ans)
def main():
  N = int(input())
  A = list(map(int, input().split()))
  if 0 in A:
    print(0)
    return
  prd = 1
  for a in A:
    prd *= a
    if prd > 1000000000000000000:
      print(-1)
      return
  print(prd)

main()
def main():
  n = int(input())
  a = list(map(int, input().split()))
  if 0 in a:
    print(0)
    return
  
  ans = 1
  for i in a:
    ans *= i
    if ans > (10 ** 18):
      print(-1)
      return
  print(ans)
  
main()
n = int(input())
li = list(map(int, input().split()))
ans = 1
flg = 0
for i in range(n):
  if flg==1 and li[i]!=0:
    continue
  elif li[i]==0:
    ans = 0
    break
  else:
    ans *= li[i]
  if(ans>1000000000000000000):
    flg = 1
if flg==1 and ans==0:
  print(ans)
elif flg==1:
  print(-1)
else:
  print(ans)
n = int(input())
a = list(map(int,input().split()))
ans=1
if 0 in a:
    ans=0
else:
    for i in a:
        ans*=i
        if ans>10**18:
            ans=-1
            break
print(ans)
import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()
if A[0] == 0:
    print(0)
    sys.exit()
    
ans = 1
cond = 0
for a in A:
    ans *= a
    if ans > 10**18:
        cond = 1
        break

if cond:
    print(-1)
else:
    print(ans)
n = int(input())
a = list(map(int, input().split()))

ans = 1
t = 1e18
if 0 in a:
    print(0)
    exit(0)

for i in range(n):
    ans *= a[i]
    if ans > t:
        print(-1)
        exit(0)

print(ans)
n = int(input())
a =list(map(int, input().split()))
if 0 in a:
  print(0)
else :
  prod = 1
  for x in a:
    prod *= x
    if prod:
      if prod > 10**18:
        print(-1)
        break
    else :
      print(0)
      break
  else :
    print(prod)
n = int(input())
N = list(map(int, input().split()))
ans=1
N.sort()
for i in range(n) :
    ans *= N[i]
    if ans > 10**18 :
        ans = -1
        break
print( ans )
a = input()
l = list(map(int,input().split()))
ans = 1
if 0 in l:
    print(0)
    exit()
for i in l:
    ans *= i
    if ans>10**18:
        print(-1)
        exit()
if ans > 10**18:
    ans=-1
print(ans)
n=int(input())
a=list(map(int,input().split()))
ans=1
out=10**18
for i in range(n):
    ans=ans*a[i]
    if out<ans:
        ans=-1
        break
for i in range(n):
    if a[i]==0:
        ans=0
        break
print(ans)
n=int(input())
a=input().split()
aa=1
for i in range(n):
    aa*=int(a[i])
    if aa>10**18:
        aa=-1
        break
if "0" in a:
    aa=0
print(aa)
N=int(input())
As=list(map(int,input().split()))

Ans=1
if As.count(0):
    print(0)
    exit()
else:
    for A in range(N):
        if Ans>10**18:
            Ans=-1
            print(Ans)
            exit()
        else:
            NewAns=Ans*As[A]
            Ans=NewAns
    if Ans>10**18:
        Ans=-1
    
    print(Ans)
def resolve():
    import numpy as np
    from decimal import Decimal

    n = int(input())
    A = np.array(list(map(Decimal, input().split())))
    if 0 in A:
        print(0)
        return

    a = Decimal(1)
    for b in A:
        a *= b
        if a > 10**18:
            print(-1)
            return
    print(a)

resolve()
N=int(input())

A=sorted([int(x) for x in input().split()],reverse=True)
if A[-1]==0:
  print(0)
else:
  m=1
  for a in A:
    m*=a
    if m>10**18:
      break
  print(m if m<=10**18 else -1)
n = int(input())
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in range(0,n):
        ans *= a[i]
        if ans >= 1000000000000000001:
            ans = -1
            break
    print(ans)
n=int(input())
A=list(map(int,input().split()))
ans=1
if 0 in A:
    print(0);exit()
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 ()))
max = 10**18
if 0 in A:
  print(0)
  exit()
  
prod = 1
for a in A:
  prod *= a
  if prod > max:
    print(-1)
    exit()
print(prod)
n = int(input())
a = list(map(int, input().split()))

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

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
N = int(input())
A = list(map(int,input().split()))
ret = 1
if 0 in A:
    print(0)
    exit()

for i in A:
    ret *= i
    if ret > 10**18:
        ret = -1
        break
print(ret)
n = int(input())

a = [*map(int, input().split())]
for e in a:
    if e == 0:
        print(0)
        exit(0)

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

print(ans)
def main():
    n = int(input())
    ary = [int(i) for i in input().split()]
    ary = sorted(ary)

    if ary[0] == 0:
        print(0)
        return

    prod = 1
    for i in reversed(range(n)):
        prod *= ary[i]
        if prod > 1000000000000000000:
            print(-1)
            return

    print(prod)
main()
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
i = 0
f = True
if 0 in As:
  print("0")
else:
  for x in As:
    if i == 0:
      i += 1
      continue
    c = c * x 
    if 1000000000000000001 <= c:
      print("-1")
      f = False
      break
  if f:
    print(c)
N = int(input())
A = list(map(int, input().split()))

ans = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        ans *= A[i]
        if 10 ** 18 < ans:
            ans = -1
            break
    print(ans)
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)


resolve()
n = int(input())
a = sorted(list(map(int,input().split())))
u = 10**18
ans = 1
for i in a:
    ans *= i
    if i == 0:
        print(0)
        exit()
    if ans > u:
        print(-1)
        exit()
print(ans)
input()
r = 1
for x in input().split():
  r = max(-1, r * int(x))
  if r > 1e18:
    r = -1
print(r)
n = int(input())
l = list(map(int, input().split()))
l.sort()
c = 1
i = 0
while i < n:
  c *= l[i]
  i += 1
  if c > 1000000000000000000:
    break
if c <= 1000000000000000000:
  print(c)
else:
  print(-1)
N = int(input())
A = list(map(int,input().split()))
lim = 10**18

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

  
ans = 1
A.sort(reverse = True)
for i in range(len(A)):
  ans = ans * A[i] 
  if ans > lim:
    print(-1)
    exit()

if ans > lim:
  print(-1)
else:
  print(ans)
n = int(input())
a = list(map(int, input().split()))
a.sort()
res = 1
for i in range(n):
	res *= a[i]
	if res > 1e18:
		print(-1)
		exit(0)
print(res)
def main():
    n = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        return 0
    result = 1

    for x in A:
        result*=x
        if result>1000000000000000000:
            return -1
    return result
print(main())
n = int(input())
a = list(map(int, input().split()))
ans = 1

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

for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        print(-1)
        exit()
print(ans)
N = int(input())
arr = [int(x) for x in input().split()]
arr.sort()
prod = 1
for i in arr:
	prod *= i
	if prod>10**18:
		prod = -1
		break
print(prod)
# -*- coding:utf-8 -*-
import sys
def main():
  n = int(input().strip())
  l = list(map(int, input().split()))
  sum = 1
  if 0 in l :
    print (0)
    return

  for i in l:
    sum *= i
    if sum - 1000000000000000000 > 0:
      print (-1)
      return
  print (sum)
main()
N = int(input())
a = list(map(int, input().split()))

ans = 1
can = 1
zero = 0

if 0 in a:
    zero = 1
    ans = 0

if(zero==0):
    for i in range(N):
        ans = ans * a[i]
        if(ans>1000000000000000000):
            can = 0
            break

if(can==1):
    print(ans)
else:
    print(-1)
n,*a=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 = int(input())
a = list(map(int, input().split()))
already = False
for i in range(len(a)):
    if a[i] == 0:
        print(0)
        already = True
        break
ans = 1
if not already:
    for i in range(len(a)):
        ans *= a[i]
        if ans > 1000000000000000000:
            print(-1)
            already = True
            break

if ans <= 1000000000000000000 and not already:
    print(ans)
n = int(input())
a = list(map(int,input().split()))
res = 1

if 0 not in a:

    for i in range(n):
        res = res * a[i]
        
        if res > 1000000000000000000:
            res = -1
            break
else:
    res = 0

print(res)
MX = 10**18
def fun(a,n):
	if max(a) > MX:
		return -1
	if 0 in a:
		return 0
	res = a[0]
	for i in range(1,n):
		res = res * a[i]
		if res > MX:
			return -1
	return res

n = int(input())
a = list(map(int,input().split()))
print(fun(a,n))
import math
n = int(input())
la = [int(i) for i in input().split()]
la.sort(reverse=True)
ans = 1

if la[-1] == 0:
    print(0)
    exit()

for a in la:
    if a > 1000000000000000000:
        print(-1)
        exit()
    ans *= a
    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
if 0 in a:
  ans = 0
print(ans)
from typing import Iterable


def multply(nums: Iterable[int]) -> int:
    if 0 in nums:
        return 0

    result = 1

    for i in nums:
        result *= i
        if result > 10**18:
            return -1

    return result

count_num = int(input())
nums = map(int, input().split())
print(multply(list(nums)))
n = int(input())
S = list(map(int,input().split()))
if 0 in S:
    print(0)
else:
    i = 0
    m = 1
    while i < n:
        m = m*S[i]
        if m > 1000000000000000000:
            print(-1)
            break
        i += 1
    else:
        print(m)
N = int(input())
p = list(map(int, input().split()))

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

for i in range(N-1):
  p[i+1] = p[i] * p[i+1]
  if p[i+1] > 10**18:
    print('-1')
    exit()
print(p[i+1])
N = int(input())
A = sorted(list(map(int,input().split())))
X = 1

if A[0]==0:
  print(0)

else:
  for a in A:
    X*=a
    if X>=1000000000000000001:
      print(-1)
      break
  else:
    print(X)
n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
    ans *= i
    if ans>10**18:
        ans = -1
        break
if 0 in a:
    ans =0
print(ans)
import sys
N=int(input())
s = list(map(int, input().split()))
ans =1
for i in s:
    if i==0:
        print(0)
        sys.exit()
    
for i in s:
    ans*=i
    if ans>1e18:
        print(-1)
        sys.exit()

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

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

    print(ans)
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    exit()
ans = 1
for a in A:
    ans *= a
    if ans > 10 ** 18:
        print(-1)
        exit()

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

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

    print(ans)
import sys

max = 10**18

n = int(input())
a = [int(x) for x in input().split()]
if 0 in a:
  print(0)
  sys.exit()

ans = 1

for num in a:
  ans *= num
  if ans > max:
    ans = -1
    break
print(ans)
th = 10 ** 18
n = int(input())
a = map(int, input().split())

ans = 1
for ai in a:
  ans *= ai
  if ans > th:
    if 0 in a:
      print(0)
    else:
      print(-1)
    exit()
print(ans)
n = int(input())
arr = []

z=False
for x in input().split(' '):
    if x == '0':
        z = True
    arr.append(int(x))
if z == True:
    print(0)

else:
    ans = 1
    for x in arr:
        ans *= x
        if ans > int(1e18):
            print(-1)
            exit(0)
    
    print(ans)
n = int(input())
A = list(map(int, input().split()))
s = 1
if min(A) == 0:
  print(0)
  exit(0)
for i in range(n):
  s *= A[i]
  if s > 1e18:
    print(-1)
    exit(0)
print(s)
x = input()
y = [int(a) for a in input().split(" ")]
if 0 in y:
  print(0)
  exit(0)
res = 1
for i in y:
  res *= i
  if res > int(1e+18):
    print(-1)
    exit(0)
print(res)
# coding: utf-8
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for ai in a:
        ans = ans * ai
        if ans > 10 ** 18:
            ans = -1
            break
print(ans)
n = int(input())
nums = list(map(int, input().split()))
res = 1
for i in range(n):
    if( nums[i] == 0):
        res = 0
if(res != 0):
    for i in range(n):
        res *= nums[i]
        if(res > 1000000000000000000):
            break
if res <= 1000000000000000000:
    print(res)
else:
    print(-1)
import sys
n=int(input())
a=list(map(int,input().split()))
m=1
if 0 in a:
  print(0)
  sys.exit()
for i in range(n):
  m*=a[i]
  if m>10**18:
    print(-1)
    sys.exit()
print(m)
# coding: utf-8
# Your code here!
N=int(input())
List = list(map(int, input().split()))
List=sorted(List)
List=List[::-1]
#print(List)
if List.count(0)!=0:
    print(0)
    quit()
ANS=List[0]
i=1
while i<N:
    ANS=ANS*List[i]
    if ANS>1000000000000000000:
        print(-1)
        quit()
    i+=1

print(ANS)
N = int(input())
A = sorted(map(int, input().split()))

ans = 1

for x in range(N):
    ans *= A[x]
    if ans > 10**18:
        ans = -1
        break
        
print(ans)
n=int(input())
s = input().split(' ')
ans=1
for i in s:
    if int(i) == 0:
        print(0)
        exit()
for i in s:
    ans=ans*int(i)
    if(ans>1000000000000000000):
        print(-1)
        exit()
print(ans)
N = int(input())
A = sorted([int(i) for i in input().split(" ")],reverse=True)
ans = 1
flag = 1
if 0 in A:
    print(0)
else:
    for a in A:
        ans*=a
        if ans>10**18:
            print(-1)
            flag = 0
            break
    if flag:
        print(ans)
import sys

n = int(input())
a_list = list(map(int,input().split()))

if 0 in a_list:
  print(0)
  sys.exit()

cur = 1
for a in a_list:
  cur *= a
  if cur > 10 ** 18:
    print(-1)
    sys.exit()

print(cur)