Buggy python submission (verdict: Time Limit Exceeded):
#125
import fractions
n = int(input())
a = [int(x) for x in input().split(' ')]
all_m = []
for i in range(1,n-1):
    a_1 = a[:i]
    a_2 = a[i+1:]
    m_1 = a_1[0]
    m_2 = a_2[0]
    for j in range(len(a_1)-1):
        m_1 = fractions.gcd(m_1,a_1[j+1])
    for j in range(len(a_2)-1):
        m_2 = fractions.gcd(m_2,a_2[j+1])
    all_m.append(fractions.gcd(m_1,m_2))
m = a[1]
for j in range(1,n-1):
    m = fractions.gcd(m,a[j+1])
all_m.append(m)
m = a[0]
for j in range(n-2):
    m = fractions.gcd(m,a[j+1])
all_m.append(m)
print(max(all_m))

Fixed submission:
#125
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split(' ')]

m_r = [0]
for i in range(n-1):
    m_r.append(gcd(m_r[-1], a[i]))

m_l = [0]
for i in range(1, n):
    m_l.append(gcd(m_l[-1], a[-i]))

m = []
for i in range(n):
    m.append(gcd(m_r[i], m_l[-i-1]))
print(max(m))

Buggy python submission (verdict: Runtime Error):
#125
import fractions
n = int(input())
a = [int(x) for x in input().split(' ')]
all_m = []
for i in range(1,n-1):
    a_1 = a[:i]
    a_2 = a[i+1:]
    m_1 = a_1[0]
    m_2 = a_2[0]
    for j in range(len(a_1)-1):
        m_1 = fractions.gcd(m_1,a_1[j+1])
    for j in range(len(a_2)-1):
        m_2 = fractions.gcd(m_2,a_2[j+1])
    all_m.append(fractions.gcd(m_1,m_2))
m = a[1]
for j in range(1,n-1):
    m = fractions.gcd(m,a[j+1])
all_m.append(m)
m = a[0]
for j in range(n-2):
    m = fractions.gcd(m,a[j+1])
all_m.appendm(m)
print(max(all_m))

Fixed submission:
#125
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split(' ')]

m_r = [0]
for i in range(n-1):
    m_r.append(gcd(m_r[-1], a[i]))

m_l = [0]
for i in range(1, n):
    m_l.append(gcd(m_l[-1], a[-i]))

m = []
for i in range(n):
    m.append(gcd(m_r[i], m_l[-i-1]))
print(max(m))

Buggy python submission (verdict: Runtime Error):
#125
import fractions
n = int(input())
a = [int(x) for x in input().split(' ')]
all_m = []
for i in range(1,n-1):
    a_1 = a[:i]
    a_2 = a[i+1:]
    m_1 = a_1[0]
    m_2 = a_2[0]
    for j in range(len(a_1)-1):
        m_1 = fractions.gcd(m_1,a_1[j+1])
    for j in range(len(a_2)-1):
        m_2 = fractions.gcd(m_2,a_2[j+1])
    all_m.append(fractions.gcd(m_1,m_2))
m = a[1]
for j in range(1,n):
    m = fractions.gcd(m,a[j+1])
all_m.append(m)
m = a[0]
for j in range(n-1):
    m = fractions.gcd(m,a[j+1])
all_m.appendm(m)
print(max(all_m))

Fixed submission:
#125
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split(' ')]

m_r = [0]
for i in range(n-1):
    m_r.append(gcd(m_r[-1], a[i]))

m_l = [0]
for i in range(1, n):
    m_l.append(gcd(m_l[-1], a[-i]))

m = []
for i in range(n):
    m.append(gcd(m_r[i], m_l[-i-1]))
print(max(m))

Buggy python submission (verdict: Runtime Error):
#125
import 
n = int(input())
a = [int(x) for x in input().split(' ')]
all_m = []
for i in range(1,n-1):
    a_1 = a[:i]
    a_2 = a[i+1:]
    m_1 = a_1[0]
    m_2 = a_2[0]
    for j in range(len(a_1)-1):
        m_1 = math.gcd(m_1,a_1[j+1])
    for j in range(len(a_2)-1):
        m_2 = math.gcd(m_2,a_2[j+1])
    all_m.append(fractions.gcd(m_1,m_2))
m = a[1]
for j in range(1,n):
    m = math.gcd(m,a[j+1])
all_m.append(fractions.gcd(m))
m = a[0]
for j in range(n-1):
    m = math.gcd(m,a[j+1])
all_m.append(fractions.gcd(m))
print(max(all_m))

Fixed submission:
#125
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split(' ')]

m_r = [0]
for i in range(n-1):
    m_r.append(gcd(m_r[-1], a[i]))

m_l = [0]
for i in range(1, n):
    m_l.append(gcd(m_l[-1], a[-i]))

m = []
for i in range(n):
    m.append(gcd(m_r[i], m_l[-i-1]))
print(max(m))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
n = int(input())
a = [int(x) for x in input().split(' ')]
all_m = []
for i in range(n):
    get_a = a[:i] + a[i+1:]
    m = get_a[0]
    for j in range(n-2):
        m = fractions.gcd(m,get_a[j+1])
    all_m.append(m)
print(max(all_m))

Fixed submission:
#125
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split(' ')]

m_r = [0]
for i in range(n-1):
    m_r.append(gcd(m_r[-1], a[i]))

m_l = [0]
for i in range(1, n):
    m_l.append(gcd(m_l[-1], a[-i]))

m = []
for i in range(n):
    m.append(gcd(m_r[i], m_l[-i-1]))
print(max(m))