Buggy python submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n):
	if i == 0:
		ma = right[n-2]
	elif i == n-1:
		if ma < left[n-2]:
			ma = left[n-2]
	elif ma < fractions.gcd(left[i-1], right[n-2-i]):
		ma = fractions.gcd(left[i-1], right[n-2-i])
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n):
	if i == 0:
		ma = right[n-2]
	elif i == n-1:
		if ma < left[n-2]:
			ma = left[n-2]
	else:
		gc = fractions.gcd(left[i-1], right[n-2-i])
		if ma < gc:
			ma = gc
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Buggy python submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n):
	if i == 0:
		ma = right[n-2]
	elif i == n-1:
		if ma < left[n-2]:
			ma = left[n-2]
	elif ma < math.gcd(left[i-1], right[n-2-i]):
		ma = fractions.gcd(left[i-1], right[n-2-i])
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n):
	if i == 0:
		ma = right[n-2]
	elif i == n-1:
		if ma < left[n-2]:
			ma = left[n-2]
	else:
		gc = fractions.gcd(left[i-1], right[n-2-i])
		if ma < gc:
			ma = gc
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Buggy python submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n-1):
	if i == 0:
		ma = right[n-2]
	elif ma < fractions.gcd(left[i-1], right[n-2-i]):
		ma = fractions.gcd(left[i-1], right[n-2-i])
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n):
	if i == 0:
		ma = right[n-2]
	elif i == n-1:
		if ma < left[n-2]:
			ma = left[n-2]
	else:
		gc = fractions.gcd(left[i-1], right[n-2-i])
		if ma < gc:
			ma = gc
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Buggy python submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n-1):
	if i == 0:
		ma = right[n-2]
	elif ma < fractions.gcd(left[i-1], right[n-2-i]):
		ma = fractions.gcd(left[i-1], right[n-2-i])
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))

left = []
left.append(a[0])
right = []
right.append(a[n-1])
for i in range(n-2):
	right.append(fractions.gcd(right[i], a[n-2-i]))

for i in range(n):
	if i == 0:
		ma = right[n-2]
	elif i == n-1:
		if ma < left[n-2]:
			ma = left[n-2]
	else:
		gc = fractions.gcd(left[i-1], right[n-2-i])
		if ma < gc:
			ma = gc
		left.append(fractions.gcd(left[i-1], a[i]))

print(ma)