import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    ans = gcd(sorted(A,reverse=True))
    print(ans)

if __name__ == '__main__':
    main() import math math from functools import reduce def gcd(numbers):
    return reduce(math.gcd, numbers) gcd return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers numbers numbers def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    ans = gcd(sorted(A,reverse=True))
    print(ans) main N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x A = [int(x) for x in input().split()] A [int(x) for x in input().split()] ans = gcd(sorted(A,reverse=True)) ans gcd(sorted(A,reverse=True)) gcd sorted(A,reverse=True) sorted A reverse=True reverse True print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def gcd(numbers):
    return reduce(math.gcd, numbers) def gcd(numbers):
    return reduce(math.gcd, numbers) gcd def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    ans = gcd(sorted(A,reverse=True))
    print(ans) def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    ans = gcd(sorted(A,reverse=True))
    print(ans) main
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    ans = gcd(sorted(A,reverse=True))
    print(ans)

if __name__ == '__main__':
    main()