from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
now = a[0]
for i in range(1,n):
    now = math.gcd(now, a[i])
print(now) from collections import Counter,defaultdict,deque from heapq import heappop,heappush from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys math itertools fractions pprint sys.setrecursionlimit(10**8) sys.setrecursionlimit sys setrecursionlimit 10**8 10 8 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 INF = float('inf') INF float('inf') float 'inf' def inp(): return int(sys.stdin.readline()) inp def inpl(): return list(map(int, sys.stdin.readline().split())) inpl n = inp() n inp() inp a = inpl() a inpl() inpl now = a[0] now a[0] a 0 for i in range(1,n):
    now = math.gcd(now, a[i]) i range(1,n) range 1 n now = math.gcd(now, a[i]) now math.gcd(now, a[i]) math.gcd math gcd now a[i] a i print(now) print now def inpl(): return list(map(int, sys.stdin.readline().split())) def inpl(): return list(map(int, sys.stdin.readline().split())) inpl a = inpl() inpl() a mod = 10**9+7 10**9+7 mod INF = float('inf') float('inf') INF def inp(): return int(sys.stdin.readline()) def inp(): return int(sys.stdin.readline()) inp n = inp() inp() n now = a[0] a[0] now now = math.gcd(now, a[i]) math.gcd(now, a[i]) now
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
now = a[0]
for i in range(1,n):
    now = math.gcd(now, a[i])
print(now)