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

import fraction
from functools import reduce

def gcd_(*numbers):
    return reduce(fraction.gcd, numbers)

dp=[]
for i in range(n):
    aa=list(a)
    del aa[i]
    dp.append(gcd_(*aa))

print(max(dp))


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

def gcd(a,b):
    if a == 0:
        return b
    if b == 0:
        return a
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r
    return a

l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])

m=[]
for i in range(n):
    m.append(gcd(l[i],r[i+1]))

print(max(m))

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

import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

dp=[]
for i in range(n):
    aa=list(a)
    del aa[i]
    dp.append(gcd(*aa))

print(max(dp))


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

def gcd(a,b):
    if a == 0:
        return b
    if b == 0:
        return a
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r
    return a

l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])

m=[]
for i in range(n):
    m.append(gcd(l[i],r[i+1]))

print(max(m))

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

import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

dp=[]
for i in range(n):
    aa=list(a)
    del aa[i]
    dp.append(gcd(*aa))

print(max(dp))

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

def gcd(a,b):
    if a == 0:
        return b
    if b == 0:
        return a
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r
    return a

l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])

m=[]
for i in range(n):
    m.append(gcd(l[i],r[i+1]))

print(max(m))

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

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

dp=[]
for i in range(n):
    aa=list(a)
    del aa[i]
    dp.append(gcd(*aa))

print(max(dp))


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

def gcd(a,b):
    if a == 0:
        return b
    if b == 0:
        return a
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r
    return a

l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])

m=[]
for i in range(n):
    m.append(gcd(l[i],r[i+1]))

print(max(m))

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

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

dp=[]
for i in range(n):
    aa=list(a)
    del aa[i]
    dp.append(gcd(*aa))

print(max(dp))


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

def gcd(a,b):
    if a == 0:
        return b
    if b == 0:
        return a
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r
    return a

l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])

m=[]
for i in range(n):
    m.append(gcd(l[i],r[i+1]))

print(max(m))