import bisect,copy,heapq,string
from collections import *
from math import *
from itertools import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = LIST()

x = a[0]
for y in a:
        x = gcd(x, y)
print(x) import bisect,copy,heapq,string bisect copy heapq string from collections import * from math import * from itertools import * import sys sys def input() : return sys.stdin.readline().strip() input def INT()   : return int(input()) INT def MAP()   : return map(int,input().split()) MAP def LIST()  : return list(MAP()) LIST n = INT() n INT() INT a = LIST() a LIST() LIST x = a[0] x a[0] a 0 for y in a:
        x = gcd(x, y) y a x = gcd(x, y) x gcd(x, y) gcd x y print(x) print x n = INT() INT() n x = a[0] a[0] x a = LIST() LIST() a def input() : return sys.stdin.readline().strip() def input() : return sys.stdin.readline().strip() input def INT()   : return int(input()) def INT()   : return int(input()) INT def MAP()   : return map(int,input().split()) def MAP()   : return map(int,input().split()) MAP x = gcd(x, y) gcd(x, y) x def LIST()  : return list(MAP()) def LIST()  : return list(MAP()) LIST
import bisect,copy,heapq,string
from collections import *
from math import *
from itertools import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = LIST()

x = a[0]
for y in a:
        x = gcd(x, y)
print(x)