Buggy python submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        exit()
    else:
        continue
print(ans)

Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))

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


Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        exit
    else:
        continue
    
  if ans<1000000000000000001:
      print(ans)
  else:
      print(-1)


Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        exit
    else:
        continue
    
  if ans<1000000000000000001:
      print(ans)
  else:
      print(-1)


Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        exit
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

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


Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

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

Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

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


Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator
n=int(input())
li=list(map(int,input().split()))

ans = functools.reduce(operator.mul, li)
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
li=list(map(int,input().split()))
ans=li[0]
for i in range(1,n):
    ans*=li[i]

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

Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)