import sys
from math import gcd
from functools import reduce

readline = sys.stdin.buffer.readline


def main():
    N = int(readline())
    A = map(int, readline().split())

    print(reduce(gcd, A))
    return


if __name__ == '__main__':
    main() import sys sys from math import gcd from functools import reduce readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline def main():
    N = int(readline())
    A = map(int, readline().split())

    print(reduce(gcd, A))
    return main N = int(readline()) N int(readline()) int readline() readline A = map(int, readline().split()) A map(int, readline().split()) map int readline().split() ().split () readline split print(reduce(gcd, A)) print reduce(gcd, A) reduce gcd A return if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline def main():
    N = int(readline())
    A = map(int, readline().split())

    print(reduce(gcd, A))
    return def main():
    N = int(readline())
    A = map(int, readline().split())

    print(reduce(gcd, A))
    return main
import sys
from math import gcd
from functools import reduce

readline = sys.stdin.buffer.readline


def main():
    N = int(readline())
    A = map(int, readline().split())

    print(reduce(gcd, A))
    return


if __name__ == '__main__':
    main()
