import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = list(mapint())
from math import gcd

g = 0
for a in As:
    g = gcd(g, a)
print(g) import sys sys def input(): return sys.stdin.readline().strip() input def mapint(): return map(int, input().split()) mapint sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 N = int(input()) N int(input()) int input() input As = list(mapint()) As list(mapint()) list mapint() mapint from math import gcd g = 0 g 0 for a in As:
    g = gcd(g, a) a As g = gcd(g, a) g gcd(g, a) gcd g a print(g) print g As = list(mapint()) list(mapint()) As N = int(input()) int(input()) N def mapint(): return map(int, input().split()) def mapint(): return map(int, input().split()) mapint g = 0 0 g g = gcd(g, a) gcd(g, a) g def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = list(mapint())
from math import gcd

g = 0
for a in As:
    g = gcd(g, a)
print(g)