from functools import reduce
import math


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


def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = gcd_list(A)
    print(ans)


if __name__ == "__main__":
    main() from functools import reduce import math math def gcd_list(numbers):
    return reduce(math.gcd, numbers) gcd_list return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers numbers numbers def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = gcd_list(A)
    print(ans) main 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 = gcd_list(A) ans gcd_list(A) gcd_list A print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = gcd_list(A)
    print(ans) def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = gcd_list(A)
    print(ans) main def gcd_list(numbers):
    return reduce(math.gcd, numbers) def gcd_list(numbers):
    return reduce(math.gcd, numbers) gcd_list
from functools import reduce
import math


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


def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = gcd_list(A)
    print(ans)


if __name__ == "__main__":
    main()