from functools import reduce
import math
def main():
    n = int(input())
    A = list(map(int, input().split()))
    print(reduce(math.gcd, A))

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

if __name__ == '__main__':
    main()
