Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import fractions
import copy
from functools import reduce

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

N = int(input())
A = list(map(int, str(input()).split()))

gcds = list()
for i in range(0,N):
    B = copy.deepcopy(A)
    B.pop(i)
    tmp = gcd_list(B)
    gcds.append(tmp)

print(max(gcds))


Fixed submission:
# -*- coding: utf-8 -*-
from fractions import gcd

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))

    L = [0]
    R = [0]

    for i in range(N):
        L.append(gcd(L[-1], A[i]))
    for i in range(N-1, -1, -1):
        R.append(gcd(R[-1], A[i]))

    ans = 0

    for i in range(N):
        ans = max(ans, gcd(L[i], R[N - i - 1]))

    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import fractions
import copy
from functools import reduce

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

N = int(input())
A = list(map(int, str(input()).split()))

gcds = list()
for i in range(0,N):
    B = copy.deepcopy(A)
    B.pop(i)
    tmp = gcd_list(B)
    gcds.append(tmp)

print(max(gcds))


Fixed submission:
# -*- coding: utf-8 -*-
from fractions import gcd

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))

    L = [0]
    R = [0]

    for i in range(N):
        L.append(gcd(L[-1], A[i]))
    for i in range(N-1, -1, -1):
        R.append(gcd(R[-1], A[i]))

    ans = 0

    for i in range(N):
        ans = max(ans, gcd(L[i], R[N - i - 1]))

    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import fractions
import copy
from functools import reduce

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

N = int(input())
A = list(map(int, str(input()).split()))

gcds = list()
for i in range(0,N):
    B = copy.deepcopy(A)
    B.pop(i)
    tmp = gcd_list(B)
    gcds.append(tmp)

print(max(gcds))


Fixed submission:
# -*- coding: utf-8 -*-
from fractions import gcd

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))

    L = [0]
    R = [0]

    for i in range(N):
        L.append(gcd(L[-1], A[i]))
    for i in range(N-1, -1, -1):
        R.append(gcd(R[-1], A[i]))

    ans = 0

    for i in range(N):
        ans = max(ans, gcd(L[i], R[N - i - 1]))

    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import fractions
import copy
from functools import reduce

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

N = int(input())
A = list(map(int, str(input()).split()))

gcds = list()
for i in range(0,N):
    B = copy.deepcopy(A)
    B.pop(i)
    tmp = gcd_list(B)
    gcds.append(tmp)

print(max(gcds))


Fixed submission:
# -*- coding: utf-8 -*-
from fractions import gcd

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))

    L = [0]
    R = [0]

    for i in range(N):
        L.append(gcd(L[-1], A[i]))
    for i in range(N-1, -1, -1):
        R.append(gcd(R[-1], A[i]))

    ans = 0

    for i in range(N):
        ans = max(ans, gcd(L[i], R[N - i - 1]))

    print(ans)