#!/bin/python3
#Accepted - 36 points

n = int(input().strip())
a = list(map(int, input().strip().split(' ')))

if n == 1:
    print (a[0] + 1)

a = sorted(a)

for d in range(2, a[1] + 1):
    n = 0
    for i in a:
        if i % d == 0:
            n += 1

    if n == len(a) - 1:
        print (d)
        break


bdf463fe1e630464adbd60c71654b0b47625c349
<mask token>

<mask token>
if n == 1:
    print(a[0] + 1)
<mask token>
for d in range(2, a[1] + 1):
    n = 0
    for i in a:
        if i % d == 0:
            n += 1
    if n == len(a) - 1:
        print(d)
        break

n = int(input().strip())
a = list(map(int, input().strip().split(' ')))
if n == 1:
    print(a[0] + 1)
a = sorted(a)
for d in range(2, a[1] + 1):
    n = 0
    for i in a:
        if i % d == 0:
            n += 1
    if n == len(a) - 1:
        print(d)
        break

#!/bin/python3
#Accepted - 36 points

n = int(input().strip())
a = list(map(int, input().strip().split(' ')))

if n == 1:
    print (a[0] + 1)

a = sorted(a)

for d in range(2, a[1] + 1):
    n = 0
    for i in a:
        if i % d == 0:
            n += 1

    if n == len(a) - 1:
        print (d)
        break

