Buggy python submission (verdict: Runtime Error):
l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)


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

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = list(map(int,input().split()))

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
for i in range(n):
    g = 0
    for j in range(i):
        g = gcd(g, v[j])
    l_ans[i] = g
r_ans = [0] * n
for i in range(n):
    g = 0
    for j in range(i):
        g = gcd(g, v[n-1-j])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)


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

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = list(map(int,input().split()))

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = []
for i in range(n):
    g = 0
    for j in range(i):
        g = gcd(g, v[j])
    l_ans.append(g)
r_ans = []
for i in range(n):
    g = 0
    for j in range(i):
        g = gcd(g, v[n-1-j])
    r_ans.append(g)
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)


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

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
v = list(map(int,input().split()))
v = deque(v)

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

ans = 1
for i in range(n):
    v1 = v.popleft()
    g = 0
    for j in range(n-1):
        g = gcd(g, v[j])
    v.append(v1)
    ans = max(ans,g)
print(ans)


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

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from fractions import gcd
from functools import reduce
n = int(input())
v = list(map(int,input().split()))
v = deque(v)

def gcd_list(numbers):
    return reduce(gcd, numbers)

ans = 1
for i in range(n):
    v1 = v.popleft()
    g = gcd_list(v)
    v.append(v1)
    ans = max(ans,g)
print(ans)




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

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from fractions import gcd
from functools import reduce
n = int(input())
v = list(map(int,input().split()))
v = deque(v)

def gcd_list(numbers):
    return reduce(gcd, numbers)

ans = 1
for i in range(n):
    v1 = v.popleft()
    g = gcd_list(v)
    v.append(v1)
    ans = max(ans,g)
print(ans)


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

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)