from fractions import gcd


def main():
    n = int(input())
    As = list(map(int, input().split()))
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans)


if __name__ == "__main__":
    main() from fractions import gcd def main():
    n = int(input())
    As = list(map(int, input().split()))
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans) main n = int(input()) n int(input()) int input() input As = list(map(int, input().split())) As list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = gcd(As[0], As[1]) ans gcd(As[0], As[1]) gcd As[0] As 0 As[1] As 1 for i in range(2, n):
        ans = gcd(ans, As[i])
     i range(2, n) range 2 n ans = gcd(ans, As[i]) ans gcd(ans, As[i]) gcd ans As[i] As i print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    As = list(map(int, input().split()))
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans) def main():
    n = int(input())
    As = list(map(int, input().split()))
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans) main
from fractions import gcd


def main():
    n = int(input())
    As = list(map(int, input().split()))
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans)


if __name__ == "__main__":
    main()
