Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    for i in b:
        if  0 in b:
            ans = 0
            break
        ans *= i
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


Fixed submission:
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    if 0 in b:
        ans = 0
    else:
        for i in range(len(b)):
            ans *= b[i]
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    for i in b:
        if  0 in b:
            ans = 0
            break
        ans = ans*i
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


Fixed submission:
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    if 0 in b:
        ans = 0
    else:
        for i in range(len(b)):
            ans *= b[i]
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    for i in b:
        if  0 in b:
            ans = 0
            break
        ans = ans*i
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


Fixed submission:
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    if 0 in b:
        ans = 0
    else:
        for i in range(len(b)):
            ans *= b[i]
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1

    for i in b:
        if  0 in b:
            ans = 0
            break
        ans = ans*i
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


Fixed submission:
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    if 0 in b:
        ans = 0
    else:
        for i in range(len(b)):
            ans *= b[i]
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1

    for i in b:
        if  0 in b:
            ans = 0
            break
        ans = ans*i
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


Fixed submission:
if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    if 0 in b:
        ans = 0
    else:
        for i in range(len(b)):
            ans *= b[i]
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)