#import sys
#import numpy as np
import fractions
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in range(1,n):
    ans=fractions.gcd(ans,a[i])
print(ans) import fractions fractions from collections import deque 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 i in range(1,n):
    ans=fractions.gcd(ans,a[i]) i range(1,n) range 1 n ans=fractions.gcd(ans,a[i]) ans fractions.gcd(ans,a[i]) fractions.gcd fractions gcd ans a[i] a i print(ans) print ans ans=a[0] a[0] ans ans=fractions.gcd(ans,a[i]) fractions.gcd(ans,a[i]) ans a=list(map(int,input().split())) list(map(int,input().split())) a n=int(input()) int(input()) n
#import sys
#import numpy as np
import fractions
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in range(1,n):
    ans=fractions.gcd(ans,a[i])
print(ans)