n = int(eval(input()))

mon = list(map(int, input().split()))

g = min(mon)

div = []

for i in range(1, g + 1):

  if (g % i == 0):

    div.append(i)

    div.append(g // i)

  if (i * i > g):

    break

div.sort(reverse=True)

for d in div:

  mod = []

  for m in mon:

    mod.append(m % d)

  if (list(set(mod)) == [0]):

    print(d)

    break
def gcd(x, y):

  while(y):

    x, y = y, x % y

  return x

n = int(eval(input()))

mon = list(map(int, input().split()))

g = mon[0]

for i in range(1, n):

  g = gcd(g, mon[i])

print(g)
n = int(eval(input()))
mon = list(map(int, input().split()))
g = min(mon)
div = []
for i in range(1, g + 1):
    if g % i == 0:
        div.append(i)
        div.append(g // i)
    if i * i > g:
        break
div.sort(reverse=True)
for d in div:
    mod = []
    for m in mon:
        mod.append(m % d)
    if list(set(mod)) == [0]:
        print(d)
        break

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


n = int(eval(input()))
mon = list(map(int, input().split()))
g = mon[0]
for i in range(1, n):
    g = gcd(g, mon[i])
print(g)

+def gcd(x, y): +    while y: +        x, y = y, x % y +    return x + + -g = min(mon) -div = [] -for i in range(1, g + 1): -    if g % i == 0: -        div.append(i) -        div.append(g // i) -    if i * i > g: -        break -div.sort(reverse=True) -for d in div: -    mod = [] -    for m in mon: -        mod.append(m % d) -    if list(set(mod)) == [0]: -        print(d) -        break +g = mon[0] +for i in range(1, n): +    g = gcd(g, mon[i]) +print(g)