import math
def main():
    n = (int)(input())
    k = list(map(int,input().split()))
    ans = k[0]
    for i in k:
        ans = math.gcd(ans,i)
    print(ans)

main() import math math def main():
    n = (int)(input())
    k = list(map(int,input().split()))
    ans = k[0]
    for i in k:
        ans = math.gcd(ans,i)
    print(ans) main n = (int)(input()) n (int)(input()) int input() input k = list(map(int,input().split())) k list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = k[0] ans k[0] k 0 for i in k:
        ans = math.gcd(ans,i)
     i k ans = math.gcd(ans,i) ans math.gcd(ans,i) math.gcd math gcd ans i print(ans) print ans main() main def main():
    n = (int)(input())
    k = list(map(int,input().split()))
    ans = k[0]
    for i in k:
        ans = math.gcd(ans,i)
    print(ans) def main():
    n = (int)(input())
    k = list(map(int,input().split()))
    ans = k[0]
    for i in k:
        ans = math.gcd(ans,i)
    print(ans) main
import math
def main():
    n = (int)(input())
    k = list(map(int,input().split()))
    ans = k[0]
    for i in k:
        ans = math.gcd(ans,i)
    print(ans)

main()