# -*- coding: utf-8 -*-
import sys
from math import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
A=list(map(int,input().split()))
ans=A[0]
for x in A[1:]:
    ans=gcd(ans,x)
print(ans) import sys sys from math import gcd sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 INF=10**18 INF 10**18 10 18 MOD=10**9+7 MOD 10**9+7 10**9 10 9 7 input=lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip YesNo=lambda b: bool([print('Yes')] if b else print('No')) YesNo lambda b: bool([print('Yes')] if b else print('No')) bool([print('Yes')] if b else print('No')) bool [print('Yes')] if b else print('No') b [print('Yes')] print('Yes') print 'Yes' print('No') print 'No' b YESNO=lambda b: bool([print('YES')] if b else print('NO')) YESNO lambda b: bool([print('YES')] if b else print('NO')) bool([print('YES')] if b else print('NO')) bool [print('YES')] if b else print('NO') b [print('YES')] print('YES') print 'YES' print('NO') print 'NO' b int1=lambda x:int(x)-1 int1 lambda x:int(x)-1 int(x)-1 int(x) int x 1 x N=int(input()) N int(input()) int input() input A=list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans=A[0] ans A[0] A 0 for x in A[1:]:
    ans=gcd(ans,x) x A[1:] A 1: 1 ans=gcd(ans,x) ans gcd(ans,x) gcd ans x print(ans) print ans YesNo=lambda b: bool([print('Yes')] if b else print('No')) lambda b: bool([print('Yes')] if b else print('No')) YesNo int1=lambda x:int(x)-1 lambda x:int(x)-1 int1 ans=gcd(ans,x) gcd(ans,x) ans YESNO=lambda b: bool([print('YES')] if b else print('NO')) lambda b: bool([print('YES')] if b else print('NO')) YESNO A=list(map(int,input().split())) list(map(int,input().split())) A ans=A[0] A[0] ans N=int(input()) int(input()) N INF=10**18 10**18 INF input=lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input MOD=10**9+7 10**9+7 MOD
# -*- coding: utf-8 -*-
import sys
from math import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
A=list(map(int,input().split()))
ans=A[0]
for x in A[1:]:
    ans=gcd(ans,x)
print(ans)