import sys
read = sys.stdin.read
from math import gcd
def main():
    n, *a = map(int, read().split())
    r = gcd(a[0], a[1])
    if n == 2:
        print(r)
        sys.exit()
    for i1 in range(2, n):
        r = gcd(r, a[i1])
    print(r)

if __name__ == '__main__':
    main() import sys sys read = sys.stdin.read read sys.stdin.read sys.stdin sys stdin read from math import gcd def main():
    n, *a = map(int, read().split())
    r = gcd(a[0], a[1])
    if n == 2:
        print(r)
        sys.exit()
    for i1 in range(2, n):
        r = gcd(r, a[i1])
    print(r) main n, *a = map(int, read().split()) n map(int, read().split()) map int read().split() ().split () read split *a a r = gcd(a[0], a[1]) r gcd(a[0], a[1]) gcd a[0] a 0 a[1] a 1 if n == 2:
        print(r)
        sys.exit()
     n == 2 n 2 print(r) print r sys.exit() sys.exit sys exit for i1 in range(2, n):
        r = gcd(r, a[i1])
     i1 range(2, n) range 2 n r = gcd(r, a[i1]) r gcd(r, a[i1]) gcd r a[i1] a i1 print(r) print r if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main read = sys.stdin.read sys.stdin.read read def main():
    n, *a = map(int, read().split())
    r = gcd(a[0], a[1])
    if n == 2:
        print(r)
        sys.exit()
    for i1 in range(2, n):
        r = gcd(r, a[i1])
    print(r) def main():
    n, *a = map(int, read().split())
    r = gcd(a[0], a[1])
    if n == 2:
        print(r)
        sys.exit()
    for i1 in range(2, n):
        r = gcd(r, a[i1])
    print(r) main
import sys
read = sys.stdin.read
from math import gcd
def main():
    n, *a = map(int, read().split())
    r = gcd(a[0], a[1])
    if n == 2:
        print(r)
        sys.exit()
    for i1 in range(2, n):
        r = gcd(r, a[i1])
    print(r)

if __name__ == '__main__':
    main()
