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

from functools import reduce
import fractions

def gcd(num_list):
    return reduce(fractions.gcd, num_list)

max_kys = 0

for i in range(N):
    B = A.copy()
    del B[i]
    max_kys = max(max_kys, gcd(B))

print(max_kys)

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

index = list(range(N))
L = index.copy()

L[0] = 0
for i in index[:-1]:
    #print(i)
    L[i+1] = gcd(L[i], A[i])

R = index.copy()
R.append(0)
for i in reversed(index):
    #print(i)
    R[i] = gcd(R[i+1], A[i])

# confirm
#print(L)
#print(R)

M = []
for j in range(len(L)):
    m = gcd(L[j], R[j+1])
    #print(m)
    M.append(m)

# Confirm
#print(M)

# Answer
print(max(M))

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

from functools import reduce
import fractions

def gcd(num_list):
    #return reduce(math.gcd, num_list)
    return reduce(fractions.gcd, num_list)

max_kys = 0

for i in range(N):
    B = A.copy()
    B.pop(i)
    max_kys = max(max_kys, gcd(B))

print(max_kys)

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

index = list(range(N))
L = index.copy()

L[0] = 0
for i in index[:-1]:
    #print(i)
    L[i+1] = gcd(L[i], A[i])

R = index.copy()
R.append(0)
for i in reversed(index):
    #print(i)
    R[i] = gcd(R[i+1], A[i])

# confirm
#print(L)
#print(R)

M = []
for j in range(len(L)):
    m = gcd(L[j], R[j+1])
    #print(m)
    M.append(m)

# Confirm
#print(M)

# Answer
print(max(M))

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

from functools import reduce
import fractions

def gcd(num_list):
    return reduce(fractions.gcd, num_list)

kys = []

for i in range(N):
    B = A.copy()
    B.pop(i)
    kys.append(gcd(B))

print(max(kys))

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

index = list(range(N))
L = index.copy()

L[0] = 0
for i in index[:-1]:
    #print(i)
    L[i+1] = gcd(L[i], A[i])

R = index.copy()
R.append(0)
for i in reversed(index):
    #print(i)
    R[i] = gcd(R[i+1], A[i])

# confirm
#print(L)
#print(R)

M = []
for j in range(len(L)):
    m = gcd(L[j], R[j+1])
    #print(m)
    M.append(m)

# Confirm
#print(M)

# Answer
print(max(M))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

import math
from functools import reduce

def gcd(num_list):
    return reduce(math.gcd, num_list)

kys = []

for i in range(N):
    B = A.copy()
    B.pop(i)
    kys.append(gcd(B))

print(max(kys))

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

index = list(range(N))
L = index.copy()

L[0] = 0
for i in index[:-1]:
    #print(i)
    L[i+1] = gcd(L[i], A[i])

R = index.copy()
R.append(0)
for i in reversed(index):
    #print(i)
    R[i] = gcd(R[i+1], A[i])

# confirm
#print(L)
#print(R)

M = []
for j in range(len(L)):
    m = gcd(L[j], R[j+1])
    #print(m)
    M.append(m)

# Confirm
#print(M)

# Answer
print(max(M))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

import math
from functools import reduce

def gcd(num_list):
    return reduce(math.gcd, num_list)

kys = []

for i in range(N):
    B = A.copy()
    B.pop(i)
    kys.append(gcd(B))

print(max(kys))

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

index = list(range(N))
L = index.copy()

L[0] = 0
for i in index[:-1]:
    #print(i)
    L[i+1] = gcd(L[i], A[i])

R = index.copy()
R.append(0)
for i in reversed(index):
    #print(i)
    R[i] = gcd(R[i+1], A[i])

# confirm
#print(L)
#print(R)

M = []
for j in range(len(L)):
    m = gcd(L[j], R[j+1])
    #print(m)
    M.append(m)

# Confirm
#print(M)

# Answer
print(max(M))