import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

m = min(A)

mod_min = 10**9

for a in A:
    if a % m == 0:
        continue
    mod_min = min(mod_min, a % m)

if mod_min == 10**9:
    print(m)
else:
    print(math.gcd(m, mod_min)) import sys sys import math math inint = lambda: int(sys.stdin.readline()) inint lambda: int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline inintm = lambda: map(int, sys.stdin.readline().split()) inintm lambda: map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split inintl = lambda: list(inintm()) inintl lambda: list(inintm()) list(inintm()) list inintm() inintm instrm = lambda: map(str, sys.stdin.readline().split()) instrm lambda: map(str, sys.stdin.readline().split()) map(str, sys.stdin.readline().split()) map str sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split instrl = lambda: list(instrm()) instrl lambda: list(instrm()) list(instrm()) list instrm() instrm n = inint() n inint() inint A = inintl() A inintl() inintl m = min(A) m min(A) min A mod_min = 10**9 mod_min 10**9 10 9 for a in A:
    if a % m == 0:
        continue
    mod_min = min(mod_min, a % m) a A if a % m == 0:
        continue
     a % m == 0 a % m a m 0 continue mod_min = min(mod_min, a % m) mod_min min(mod_min, a % m) min mod_min a % m a m if mod_min == 10**9:
    print(m)
else:
    print(math.gcd(m, mod_min)) mod_min == 10**9 mod_min 10**9 10 9 print(m) print m print(math.gcd(m, mod_min)) print math.gcd(m, mod_min) math.gcd math gcd m mod_min instrm = lambda: map(str, sys.stdin.readline().split()) lambda: map(str, sys.stdin.readline().split()) instrm instrl = lambda: list(instrm()) lambda: list(instrm()) instrl n = inint() inint() n inint = lambda: int(sys.stdin.readline()) lambda: int(sys.stdin.readline()) inint inintm = lambda: map(int, sys.stdin.readline().split()) lambda: map(int, sys.stdin.readline().split()) inintm A = inintl() inintl() A mod_min = 10**9 10**9 mod_min mod_min = min(mod_min, a % m) min(mod_min, a % m) mod_min inintl = lambda: list(inintm()) lambda: list(inintm()) inintl m = min(A) min(A) m
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

m = min(A)

mod_min = 10**9

for a in A:
    if a % m == 0:
        continue
    mod_min = min(mod_min, a % m)

if mod_min == 10**9:
    print(m)
else:
    print(math.gcd(m, mod_min))
