Buggy python submission (verdict: Runtime Error):
from fraction import gcd
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

for i in range(n):
    left[i+1]=gcd(left[i],a[i])
    right[n-i-1]=gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n

for i in range(n):
    last[i]=(gcd(left[i],right[i+1]))


print(max(last))

Fixed submission:
from fractions import gcd
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

for i in range(n):
    left[i+1]=gcd(left[i],a[i])
    right[n-i-1]=gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n

for i in range(n):
    last[i]=(gcd(left[i],right[i+1]))


print(max(last))

Buggy python submission (verdict: Runtime Error):
import math
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

left[1]=a[0]
right[n-1]=a[n-1]

for i in range(1,n):
    left[i+1]=math.gcd(left[i],a[i])
    right[n-1-i]=math.gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n
last[0]=right[1]

for i in range(1,n-1):
    last.append(math.gcd(left[i],right[n-i]))

last[n-1]=left[n-1]

print(max(last))

Fixed submission:
from fractions import gcd
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

for i in range(n):
    left[i+1]=gcd(left[i],a[i])
    right[n-i-1]=gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n

for i in range(n):
    last[i]=(gcd(left[i],right[i+1]))


print(max(last))

Buggy python submission (verdict: Runtime Error):
import math
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

left[1]=a[0]
right[n-1]=a[n-1]

for i in range(1,n):
    left[i+1]=math.gcd(left[i],a[i])
    right[n-1-i]=math.gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n
last[0]=right[1]

for i in range(1,n-1):
    last.append(math.gcd(left[i],right[n-i]))

last[n-1]=left[n-1]

print(max(last))

Fixed submission:
from fractions import gcd
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

for i in range(n):
    left[i+1]=gcd(left[i],a[i])
    right[n-i-1]=gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n

for i in range(n):
    last[i]=(gcd(left[i],right[i+1]))


print(max(last))

Buggy python submission (verdict: Runtime Error):
import math
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

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

# print(left)
# print(right)
last=[right[n-2],left[n-2]]

for i in range(n-2):
    last.append(math.gcd(left[i],right[n-3-i]))

print(max(last))

Fixed submission:
from fractions import gcd
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

a=list(map(int,input().split()))

left=[0]*(n+1)
right=[0]*(n+1)

for i in range(n):
    left[i+1]=gcd(left[i],a[i])
    right[n-i-1]=gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n

for i in range(n):
    last[i]=(gcd(left[i],right[i+1]))


print(max(last))