Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
a = 1
if 0 in li:
    print(0)
    quit()
else:
    for x in li:
        a *= x
    if a > 10**18:
        print(-1)
        quit()
    print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split()))
a = 1
if 0 in li:
    print(0)
    quit()
else:
    for x in li:
        a *= x
    if a > 10**18:
        print(-1)
        quit()
    print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split()))
a = 1
if 0 in li:
    print(0)
    quit()
else:
    for x in li:
        a *= x
    if a > 10**18:
        print(-1)
        quit()
    else:
        print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

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

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

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

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split()))
a = 1
for x in li:
    a *= x
if a > 10**18:
    print(-1)
elif 0 in li:
    print(0)
else:
    print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy python submission (verdict: Runtime Error):
n = input()
li = list(map(int, input().split()))
a = 1
for x in li:
    a *= x
if a > 10**18:
    print(-1)
elif n > 10**5:
    print(-1)
else:
    print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = input()
li = list(map(int, input().split()))
a = reduce((lambda x, y: x * y), li)
if a > 10**18:
    print(-1)
else:
    print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split()))
a = 1
for x in li:
    a *= x
if a > 10**18:
    print(-1)
else:
    print(a)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)