Buggy python submission (verdict: Runtime Error):
import sys

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

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


Fixed submission:
import sys

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

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

Buggy python submission (verdict: Runtime Error):
import sys

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

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


Fixed submission:
import sys

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

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

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a_list = []

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

result = np.prod(a_list)

if result > 10 ** 18:
    print('-1')
else:
    print(result)


Fixed submission:
import sys

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = []

a_list = list(map(int,input().split()))
result = 1

for a in a_list:
    result *= a

if result > 10 ** 18:
    print(-1)
else:
    print(result)


Fixed submission:
import sys

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = []

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

result = 1
for a in a_list:
    result *= a

if result > 10 ** 18:
    print(-1)
else:
    print(result)


Fixed submission:
import sys

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = []

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

result = 1
for a in a_list:
    result *= a

if result > 10 ** 18:
    print(-1)
else:
    print(result)


Fixed submission:
import sys

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = []

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

result = 1
for a in a_list:
    result *= a

if result > 10 ** 18:
    print(-1)
else:
    print(result)


Fixed submission:
import sys

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

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