Buggy python submission (verdict: Time Limit Exceeded):
import fractions  # python3.5以降ではmath


def seekGcd(A, n):
    ans = A[0]
    for i in range(1, n):
        ans = fractions.gcd(ans, A[i])  # python3.5以降ではmath.gcd
    ans_list.append(ans)


n = int(input())
A = list(tuple(map(int, input().split())))
n = len(A)
ans_list = []

for i in range(n):
    p = A.pop(0)
    seekGcd(A, n-1)
    A.append(p)

print(max(ans_list))


Fixed submission:
import fractions

n = int(input())
A = list(map(int, input().split()))
n = len(A)

L = [0]
R = [0]
ans_list = []

for i in range(n-1):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[n-1-i]))

for j in range(n):
    ans_list.append(fractions.gcd(L[j], R[-j-1]))

print(max(ans_list))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions  # python3.5以降ではmath


def seekGcd(A, n):
    ans = A[0]
    for i in range(1, n):
        ans = fractions.gcd(ans, A[i])  # python3.5以降ではmath.gcd
    ans_list.append(ans)


n = int(input())
A = list(map(int, input().split()))
ans_list = []

for i in range(n):
    p = A.pop(0)
    seekGcd(A, n-1)
    A.append(p)

print(max(ans_list))


Fixed submission:
import fractions

n = int(input())
A = list(map(int, input().split()))
n = len(A)

L = [0]
R = [0]
ans_list = []

for i in range(n-1):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[n-1-i]))

for j in range(n):
    ans_list.append(fractions.gcd(L[j], R[-j-1]))

print(max(ans_list))

Buggy python submission (verdict: Runtime Error):
import fraction  # python3.5以降ではmath


def seekGcd(A, n):
    ans = A[0]
    for i in range(1, n):
        ans = fraction.gcd(ans, A[i])  # python3.5以降ではmath.gcd
    ans_list.append(ans)


n = int(input())
A = list(map(int, input().split()))
ans_list = []

for i in range(n):
    p = A.pop(0)
    seekGcd(A, n-1)
    A.append(p)

print(max(ans_list))


Fixed submission:
import fractions

n = int(input())
A = list(map(int, input().split()))
n = len(A)

L = [0]
R = [0]
ans_list = []

for i in range(n-1):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[n-1-i]))

for j in range(n):
    ans_list.append(fractions.gcd(L[j], R[-j-1]))

print(max(ans_list))

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


def seekGcd(A, n):
    ans = A[0]
    for i in range(1, n):
        ans = math.gcd(ans, A[i])
    ans_list.append(ans)


n = int(input())
A = list(map(int, input().split()))
ans_list = []

seekGcd(A, n)

for i in range(n):
    p = A.pop(0)
    seekGcd(A, n-1)
    A.append(p)

print(max(ans_list))


Fixed submission:
import fractions

n = int(input())
A = list(map(int, input().split()))
n = len(A)

L = [0]
R = [0]
ans_list = []

for i in range(n-1):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[n-1-i]))

for j in range(n):
    ans_list.append(fractions.gcd(L[j], R[-j-1]))

print(max(ans_list))

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

n = int(input())
A = list(map(int, input().split()))
ans_list = []

for i in range(n):
    p = A.pop(0)
    ans = A[0]
    for j in range(1, n-1):
        ans = math.gcd(ans, A[j])
    ans_list.append(ans)
    A.append(p)

print(max(ans_list))

Fixed submission:
import fractions

n = int(input())
A = list(map(int, input().split()))
n = len(A)

L = [0]
R = [0]
ans_list = []

for i in range(n-1):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[n-1-i]))

for j in range(n):
    ans_list.append(fractions.gcd(L[j], R[-j-1]))

print(max(ans_list))