Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())

#約数を列挙
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

A_list = [make_divisors(int(e)) for e in input().split()]

all_divisors_list=[]
for i in A_list:
  all_divisors_list += i

collected_adl = Counter(all_divisors_list)

ans = 1
for a in collected_adl.most_common():
  if a[1] <= N-2:
    break
  elif a[0]>ans:
    ans=a[0]
    
print(ans)

Fixed submission:
from collections import Counter
from functools import lru_cache

N = int(input())

#約数を列挙
@lru_cache(maxsize=1000)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

A_list = [make_divisors(int(e)) for e in input().split()]

all_divisors_list=[]

for i in A_list:
  all_divisors_list += i

collected_adl = Counter(all_divisors_list)

ans = 1
for a in collected_adl.most_common():
  if a[1] <= N-2:
    break
  elif a[0]>ans:
    ans=a[0]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
A_list = [int(e) for e in input().split()]

#約数を列挙
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

divisors_list = [make_divisors(n) for n in A_list]
all_divisors_list = []
for i in divisors_list:
  all_divisors_list += i
  
#print(all_divisors_list)
collected_adl = Counter(all_divisors_list)

ans = 1
for a in collected_adl.most_common():
  #print(a)
  if a[1] <= N-2:
    break
  elif a[0]>ans:
    ans=a[0]
    
print(ans)

Fixed submission:
from collections import Counter
from functools import lru_cache

N = int(input())

#約数を列挙
@lru_cache(maxsize=1000)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

A_list = [make_divisors(int(e)) for e in input().split()]

all_divisors_list=[]

for i in A_list:
  all_divisors_list += i

collected_adl = Counter(all_divisors_list)

ans = 1
for a in collected_adl.most_common():
  if a[1] <= N-2:
    break
  elif a[0]>ans:
    ans=a[0]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
A_list = [int(e) for e in input().split()]

#約数を列挙
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

divisors_list = [make_divisors(n) for n in A_list]
all_divisors_list = []
for i in divisors_list:
  all_divisors_list += i
  
#print(all_divisors_list)
collected_adl = Counter(all_divisors_list)

ans = 1
for a in collected_adl.most_common():
  #print(a)
  if a[1] <= N-2:
    break
  elif a[0]>ans:
    ans=a[0]
    
print(ans)

Fixed submission:
from collections import Counter
from functools import lru_cache

N = int(input())

#約数を列挙
@lru_cache(maxsize=1000)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

A_list = [make_divisors(int(e)) for e in input().split()]

all_divisors_list=[]

for i in A_list:
  all_divisors_list += i

collected_adl = Counter(all_divisors_list)

ans = 1
for a in collected_adl.most_common():
  if a[1] <= N-2:
    break
  elif a[0]>ans:
    ans=a[0]
    
print(ans)