Buggy python submission (verdict: Runtime Error):
n =int(input())
limit = 10**18
re =0

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

l.sort()

if(l[0]) != 0):
  for i in l:
    re *= i
    if(re > limit):
      print(-1)
      exit()

print(re)
  

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
re =1

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

for i in l:
    re *= i
    
if(re > 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
re =1

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

for i in l:
    re *= i
    
if(re > 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
re =1

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

for i in range(n):
    re *= l[i]
    
if(re > 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Runtime Error):
n = int(input())
re = 1

for i in range(n):
    m= int(input())
    re *= m
    
if(re > 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
re =1

list = [int(s) for s in input().split()]

for i in list:
    re *= i
    
if(re > 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
re =1

list = [int(s) for s in input().split()]
  
for i in range(n):
    re *= list[i]
    
if(re > 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)

Buggy python submission (verdict: Runtime Error):
n = int(input())
re = 1

for i in range(n):
  m = int(input())
  
  re *= m
if(re >= 1000000000000000000):
    print("-1")
else:
    print(re)

Fixed submission:
n =int(input())
limit = 10**18
re =1
 
l = list(map(int, input().split()))
 
l.sort()
#print(l)
if(l[0] == 0):
    re = 0
else:
  for i in l:
    re *= i
    #print(re)
    if(re > limit):
      re = -1
      break
print(re)