Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
if n == 2:
    answer = max(a)
else:
    for b in reversed(range(answer)):
        cnt = 2
        flag = True
        for i in range(n):
            if a[i] % answer != 0:
                cnt -= 1
            if cnt == 0:
                flag = False
        if flag:
            break
        answer -= 1
print(answer)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
if n == 2:
    pass
else:
    for b in reversed(range(answer)):
        cnt = 2
        flag = True
        for i in range(n):
            if a[i] % answer != 0:
                cnt -= 1
            if cnt == 0:
                flag = False
                break
        if flag:
            break
        answer -= 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
for b in reversed(range(answer)):
    cnt = 2
    flag = True
    for i in range(n):
        if a[i] % answer != 0:
            cnt -= 1
        if cnt == 0:
            flag = False
    if flag:
        break
    answer -= 1
print(answer)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
if n == 2:
    pass
else:
    for b in reversed(range(answer)):
        cnt = 2
        flag = True
        for i in range(n):
            if a[i] % answer != 0:
                cnt -= 1
            if cnt == 0:
                flag = False
                break
        if flag:
            break
        answer -= 1
print(answer)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
for b in range(answer).reverse():
    cnt = 2
    flag = True
    for i in range(n):
        if a[i] % answer != 0:
            cnt -= 1
        if cnt == 0:
            flag = False
    if flag:
        break
    answer -= 1
print(answer)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
if n == 2:
    pass
else:
    for b in reversed(range(answer)):
        cnt = 2
        flag = True
        for i in range(n):
            if a[i] % answer != 0:
                cnt -= 1
            if cnt == 0:
                flag = False
                break
        if flag:
            break
        answer -= 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
for b in range(answer):
    cnt = 2
    flag = True
    for i in range(n):
        if a[i] % answer != 0:
            cnt -= 1
        if cnt == 0:
            flag = False
    if flag:
        break
    answer -= 1
print(answer)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
answer = sorted(a)[1]
if n == 2:
    pass
else:
    for b in reversed(range(answer)):
        cnt = 2
        flag = True
        for i in range(n):
            if a[i] % answer != 0:
                cnt -= 1
            if cnt == 0:
                flag = False
                break
        if flag:
            break
        answer -= 1
print(answer)