import math

def main():
    _ = input()
    A = list(map(int, input().split()))
    ans = A[0]
    for a in A[1:]:
        ans = math.gcd(ans, a)
    print(ans)


if __name__ == '__main__':
    main() import math math def main():
    _ = input()
    A = list(map(int, input().split()))
    ans = A[0]
    for a in A[1:]:
        ans = math.gcd(ans, a)
    print(ans) main _ = input() _ 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 a in A[1:]:
        ans = math.gcd(ans, a)
     a A[1:] A 1: 1 ans = math.gcd(ans, a) ans math.gcd(ans, a) math.gcd math gcd ans a print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    _ = input()
    A = list(map(int, input().split()))
    ans = A[0]
    for a in A[1:]:
        ans = math.gcd(ans, a)
    print(ans) def main():
    _ = input()
    A = list(map(int, input().split()))
    ans = A[0]
    for a in A[1:]:
        ans = math.gcd(ans, a)
    print(ans) main
import math

def main():
    _ = input()
    A = list(map(int, input().split()))
    ans = A[0]
    for a in A[1:]:
        ans = math.gcd(ans, a)
    print(ans)


if __name__ == '__main__':
    main()
