Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
rslt = A[0]
 
for a in A[1:]:
  result *= a
  if rslt > 10**18:
    print(-1)
    exit()
print(rslt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
rslt = a[0]

for a in A[1:]:
  result *= a
  if rslt > 10**18:
    print(-1)
    exit()
print(rslt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
if A[0] == 0:
  print(0)
else:
  ans = 1
  for a in A:
    ans *= a
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

A.sort()
if A[0] == 0:
  print(0)
else:
  ans = 1
  for i in range(N):
    ans *= A[i]
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
 
if 0 in A:
  print(0)
else:
  ans = 1
  for i in range(N):
    ans *= A[i]
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

if 0 in A:
  print(0)
else:
  ans = 1
  for i in range(N):
    ans *= A[i]
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input().strip())
A = list(map(int, input().strip().split()))

ans = A[0]
for i in range(1,N):
  ans *= A[i]

if ans > 10**18: ans = -1

print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Runtime Error):
N = input().strip()
A = [input().strip() for i in range(N)]

r = A[0]
for i in range(1,N):
  r *= A[i]

if r > 10**8: r = -1

  
r = int(r)
print(r)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)