Buggy python submission (verdict: Runtime Error):
from math import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import os
sys.stdin = open('input.txt', 'r')

from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)


Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
from math import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
print(L, R)
for n in range(1, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)


Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

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

N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [A[0]] * (N)
R = [A[-1]] * (N)
for n in range(1, N):
    L[n] = math.gcd(A[n], L[n-1])
    R[-(n+1)] = math.gcd(A[-(n+1)], R[-n])
for n in range(1, N-1):
    temp = math.gcd(L[n-1], R[n+1])
    ans = max(temp, ans)
print(ans)

Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
temp = [0] * (max(A) + 1)
for i in range(N):
    for d in range(1, int(A[i]/2)):
        if A[i] % d == 0:
            temp[d] += 1
    temp[A[i]] += 1
for i in range(max(A), 0, -1):
    if N - 1 <= temp[i]:
        ans = i
        break
print(ans)


Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
index = [0] * N
max = 0
temp = [0] * (10**9 + 1)
for i in range(N):
    for d in range(1, int(A[i]/2)):
        if A[i] % d == 0:
            temp[d] += 1
    temp[A[i]+ 1] += 1
for i in range(N-1, 0, -1):
    if N - 1 <= temp[i]:
        ans = i
        break
print(ans)


Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 0
index = [0] * N
max = 0
temp = [0] * (10**9 + 1)
for i in range(N):
    for d in range(1, int(A[i]/2)):
        if A[i] % d == 0:
            temp[d] += 1
    temp[A[i]+ 1] += 1
for i in range(N-1, 0, -1):
    if N - 1 <= temp[i]:
        ans = i
        break
print(ans)


Fixed submission:
from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)