Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(gcd(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
for k in range(n-2):
    g = gcd(lValueList[k], lValueList[n-3-k])
  maxList.append(g)
    
print(max(maxList))



Fixed submission:
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(max(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-1-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
  for k in range(n-2):
    g = gcd(fValueList[k], lValueList[n-3-k])
    maxList.append(g)
    
  print(max(maxList))

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
import copy

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

valueList = []
maxList = []

g = a[0]
valueList.append(g)
g = a[1]
for k in range(1, n):
  g = gcd(g, a[k])
maxList.append(g)
  

for i in range(1,n):
  g = valueList[i-1]
  valueList.append(gcd(g, a[i]))
  for k in range(i+1, n):
    g = gcd(g, a[k])
  maxList.append(g)
    
print(max(maxList))



Fixed submission:
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(max(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-1-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
  for k in range(n-2):
    g = gcd(fValueList[k], lValueList[n-3-k])
    maxList.append(g)
    
  print(max(maxList))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
import copy

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

valueList = [a[0]]
maxList = []

g = a[0]
valueList.append(g)
g = a[1]
for k in range(i+1, n):
  g = gcd(g, a[k])
maxList.append(g)
  

for i in range(1,n):
  g = a[0]
  for j in range(i):
    g = gcd(g,a[j])
  valueList.append(g)
  g = valueList[i]
  for k in range(i+1, n):
    g = gcd(g, a[k])
  maxList.append(g)
    
print(max(maxList))

Fixed submission:
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(max(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-1-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
  for k in range(n-2):
    g = gcd(fValueList[k], lValueList[n-3-k])
    maxList.append(g)
    
  print(max(maxList))

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
import copy

def gcdList(numbers):
    return reduce(gcd, numbers)
  
n = int(input())
a = list(map(int,input().split()))

max = 0

for i in range(n):
  l = copy.deepcopy(a)
  l.pop(i)
  v = gcdList(l)
  if v > max:
    max = v
    
print(max)

Fixed submission:
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(max(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-1-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
  for k in range(n-2):
    g = gcd(fValueList[k], lValueList[n-3-k])
    maxList.append(g)
    
  print(max(maxList))