Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
a = map(int,input().split())
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
a = list(map(int,input().split()))
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
A = map(int,input().split())
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
a = list(map(int,input().split()))
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcb(b, a%b)
N = int(input())
A = map(int,input().split())
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
a = list(map(int,input().split()))
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcb(b, a%b)
  
N = int(input())
A = map(int,input().split())
g1=[0 for i in range(n)]
g2=[0 for i in range(n)]
g1[0]=a[0]
g2[n-1]=a[n-1]
for i in range(1,n):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(n-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(n-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[n-2],g2[1])
print(ans)

Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
a = list(map(int,input().split()))
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)