Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
flag = 0
for i in A:
    sum = sum * i
    if(i == 0):
        print(0)
        flag=2
        break
    if(sum > 10**18):
        flag=1
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=1
        break
    else:
        sum = sum * i
if(flag==0):
    if(sum > 10**18):
        print(-1)
    else:
        print(sum)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
flag = 0
for i in A:
    sum = sum * i
    if(i == 0):
        print(0)
        flag=1
        break
if(flag==0):
    if(sum > (10**18)):
        print(-1)
    else:
        print(sum)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
for i in A:
    sum = sum * i
    if(i == 0):
        print(0)
        break
    if(sum > (10**18)):
        print(-1)
        break
    elif(len(A) == N):
        print(sum)
        break



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
for i in A:
    sum = sum * i
    if(i == 0):
        print(0)
        break
    if(sum > (10**18)):
        print(-1)
        break
    elif(len(A) == N)
        print(sum)
        break



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
for i in A:
    sum = sum * i
if(sum > (10**18)):
    print(-1)
else:
    print(sum)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input(i)) for i in range(N)]
sum  = 1
for i in A:
    sum = sum * i
if(sum > (10**18)):
    print(-1)
else:
    print(sum)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)