Buggy python submission (verdict: Time Limit Exceeded):
def check():
  n=int(input())
  A=list(map(int,input().split()))
  if 0 in A:
    print(0)
    return
  a=1
  for i in A:
      a=a*i
  if a>1000000000000000000:
    print(-1)
    return
  print(a)
  return


check()


Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def check():
  n=int(input())
  A=list(map(int,input().split()))
  if 0 in A:
    print(0)
    return
  a=1
  for i in A:
      a=a*i
  if a>1000000000000000000:
    print(-1)
    return
  print(a)
  return


check()


Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))

def check(A):
  if 0 in A:
    return 0
  a=1
  for i in A:
      a=a*i
  if a>1000000000000000000:
    return(-1)
  return a

print(check(A))


Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Runtime Error):
def main ():
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
print(0)
return
prod = 1
for a in A:
prod *= a
if prod > 1000000000000000000:
print(-1)
return
print(prod)
main ()

Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
if 0 in A:
    print(0)
else:
    a=1
    for i in A:
        a=a*i
    if a>1000000000000000000:
      print(-1)
    else:
      print(a)


Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    a=1
    for i in A:
        a=a*i
        if a>1000000000000000000:
            print(-1)
        else:
            print(a)

        

Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
from collections import deque
q=deque(A)
 
ans=1
while len(q)>0:
    p=q.popleft()
    ans=ans*p
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n=int(input())
A=list(map(int,input().split()))
ans=reduce(lambda x,y:x*y,A)

if ans>1000000000000000000:
    print(-1)
else:
    print(ans)
    

Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
from collections import deque
q=deque(A)

ans=1
while len(q)>0:
    p=q.popleft()
    ans=ans*p
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)
    

Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
sum=1
for i in range(n):
    sum=sum*A[i]
if sum>1000000000000000000:
    print(-1)
else:
    print(sum)


Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
sum=1
for i in A:
    sum=sum*i
if sum>1000000000000000000:
    print(-1)
else:
    print(sum)


Fixed submission:
n=int(input())
A=list(map(int,input().split()))

ans=1

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

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


print(ans)