Buggy python submission (verdict: Time Limit Exceeded):
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[::-1][i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N):
    if i==N-1:
        pass
    else:
        R.append(fractions.gcd(R[-1], A[::-1][i]))
        L.append(fractions.gcd(L[-1], A[i]))
print(max(fractions.gcd(l,r)for l,r in zip(L,R[::-1])))

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N):
    if i==N-1:
        pass
    else:
        R.append(fractions.gcd(R[-1], A[::-1][i]))
        L.append(fractions.gcd(L[-1], A[i]))
for j in range(N):
    ans=max(ans,fractions.gcd(L[j],R[(N-1)-j]))
print(ans)

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import fractions
from functools import reduce
N=int(input())
A=list(map(int,input().split()))
l=1
for i in A:
    if len(A)>=3:
        B=copy.deepcopy(A)
        B.remove(i)
        l=max(reduce(fractions.gcd,B),l)
    else:
        l=max(i,l)
print(l)

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import fractions
from functools import reduce
N=int(input())
A=list(map(int,input().split()))
l=1
for i in A:
    if len(A)>=3:
        B=copy.deepcopy(A)
        B.remove(i)
        l=max(reduce(fractions.gcd,B),l)
    else:
        l=max(i,l)
print(l)

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import fractions
from functools import reduce
N=int(input())
A=list(map(int,input().split()))
l=[]
for i in A:
    if len(A)>=3:
        B=copy.deepcopy(A)
        B.remove(i)
        l.append(reduce(fractions.gcd,B))
    else:
        l.append(i)
print(max(l))

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce
N=int(input())
A=set(map(int,input().split()))
l=[]
for i in A:
    if A-{i}!={}:
        l.append(reduce(fractions.gcd,A-{i}))
    else:
        l.append(i)
print(max(l))

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
N=int(input())
A=set(map(int,input().split()))
l=[]
for i in A:
    l.append(reduce(math.gcd,A-{i},0))
print(max(l))

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
N=int(input())
A=set(map(int,input().split()))
l=[]
for i in A:
    l.append(reduce(math.gcd,A-{i},0))
print(max(l))

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))