import fractions



def lcm(a, b):

  return (a * b) / fractions.gcd(a, b)



N = int(eval(input()))

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



g = []

for index, a in enumerate(A):

  if index == len(A) - 1:

    break

  g.append(fractions.gcd(a, A[index+1]))

  

  

print((min(g)))
def count_section_by_zero(data):

  count = 0

  flg = False

  start = 0

  for i, d in enumerate(data):

    if flg is False and d != 0:

      count += 1

      flg = True

      

    if d == 0:

      flg = False

  return count



def input_list():

  return list(map(int, input().split()))



def input_list_str():

  return list(map(str, input().split()))



def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)



def lcm_list(numbers):

    return reduce(lcm_base, numbers, 1)



def gcd(*numbers):

    return reduce(fractions.gcd, numbers)



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



# 2で割り切れる回数

def divide_two(arg):

  c = 0

  while True:

    if c >= 2:

      break

    if arg % 2 != 0:

      break

    arg //= 2

    c += 1

  return c



# 素因数分解

def prime_factorize(n):

    a = []

    while n % 2 == 0:

        a.append(2)

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a.append(f)

            n //= f

        else:

            f += 2

    if n != 1:

        a.append(n)

    return a



def main():

  n = int(eval(input()))

  a = input_list()

  g = gcd_list(a)

  print(g)

  

import math

import fractions

import collections

from functools import reduce

main()
import fractions


def lcm(a, b):
    return (a * b) / fractions.gcd(a, b)


N = int(eval(input()))
A = list(map(int, input().split()))
g = []
for index, a in enumerate(A):
    if index == len(A) - 1:
        break
    g.append(fractions.gcd(a, A[index + 1]))
print((min(g)))

def count_section_by_zero(data):
    count = 0
    flg = False
    start = 0
    for i, d in enumerate(data):
        if flg is False and d != 0:
            count += 1
            flg = True
        if d == 0:
            flg = False
    return count


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


# 2で割り切れる回数
def divide_two(arg):
    c = 0
    while True:
        if c >= 2:
            break
        if arg % 2 != 0:
            break
        arg //= 2
        c += 1
    return c


# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def main():
    n = int(eval(input()))
    a = input_list()
    g = gcd_list(a)
    print(g)


import math
import fractions
import collections
from functools import reduce

main()

-import fractions +def count_section_by_zero(data): +    count = 0 +    flg = False +    start = 0 +    for i, d in enumerate(data): +        if flg is False and d != 0: +            count += 1 +            flg = True +        if d == 0: +            flg = False +    return count -def lcm(a, b): -    return (a * b) / fractions.gcd(a, b) +def input_list(): +    return list(map(int, input().split())) -N = int(eval(input())) -A = list(map(int, input().split())) -g = [] -for index, a in enumerate(A): -    if index == len(A) - 1: -        break -    g.append(fractions.gcd(a, A[index + 1])) -print((min(g))) +def input_list_str(): +    return list(map(str, input().split())) + + +def lcm_base(x, y): +    return (x * y) // fractions.gcd(x, y) + + +def lcm_list(numbers): +    return reduce(lcm_base, numbers, 1) + + +def gcd(*numbers): +    return reduce(fractions.gcd, numbers) + + +def gcd_list(numbers): +    return reduce(fractions.gcd, numbers) + + +# 2で割り切れる回数 +def divide_two(arg): +    c = 0 +    while True: +        if c >= 2: +            break +        if arg % 2 != 0: +            break +        arg //= 2 +        c += 1 +    return c + + +# 素因数分解 +def prime_factorize(n): +    a = [] +    while n % 2 == 0: +        a.append(2) +        n //= 2 +    f = 3 +    while f * f <= n: +        if n % f == 0: +            a.append(f) +            n //= f +        else: +            f += 2 +    if n != 1: +        a.append(n) +    return a + + +def main(): +    n = int(eval(input())) +    a = input_list() +    g = gcd_list(a) +    print(g) + + +import math +import fractions +import collections +from functools import reduce + +main()