Buggy python submission (verdict: Time Limit Exceeded):
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10
for start in range(N):
    for c in range(start+1, N):
        if a_list[start] % a_list[c] == 0:
            last_hp = a_list[c]
        elif a_list[c] % a_list[start] == 0:
            last_hp = a_list[start]
        else:
            continue
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

f = min(a_list)
a_list.remove(f)
s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)


Fixed submission:
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)

Buggy python submission (verdict: Time Limit Exceeded):
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 9

for start in range(N):
    for c in range(start+1, N):
        last_hp = gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)


Fixed submission:
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)

Buggy python submission (verdict: Time Limit Exceeded):
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 9

for start in range(N):
    for c in range(start+1, N):
        last_hp = gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)


Fixed submission:
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)

Buggy python submission (verdict: Runtime Error):
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 10

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)


Fixed submission:
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)

Buggy python submission (verdict: Runtime Error):
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 9

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)


Fixed submission:
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)

Buggy python submission (verdict: Runtime Error):
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = None

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        if min_last_hp == None:
            min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)


Fixed submission:
# import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)