import sys

input = sys.stdin.readline

n = int(eval(input()))

A = list(map(int,input().split()))

while True:

    if A.count(0) == n - 1:

        print((max(A)))

        exit()

    else:

        B = [ _  for _ in A if _ != 0  ]

        attack = min(B)

        sn = A.index(attack)

        

        for i in range(n):

            if A[i] == 0:

                pass

            else:

                if i != sn:

                    A[i] = A[i] % attack

                else:

                    pass

import sys

input = sys.stdin.readline

from functools import reduce

def gcd_list(n):

    return reduce(gcd, n)



def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)



n = int(eval(input()))

a = list(map(int, input().split()))

print((gcd_list(a)))

import sys

input = sys.stdin.readline
n = int(eval(input()))
A = list(map(int, input().split()))
while True:
    if A.count(0) == n - 1:
        print((max(A)))
        exit()
    else:
        B = [_ for _ in A if _ != 0]
        attack = min(B)
        sn = A.index(attack)
        for i in range(n):
            if A[i] == 0:
                pass
            else:
                if i != sn:
                    A[i] = A[i] % attack
                else:
                    pass

import sys

input = sys.stdin.readline
from functools import reduce


def gcd_list(n):
    return reduce(gcd, n)


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


n = int(eval(input()))
a = list(map(int, input().split()))
print((gcd_list(a)))

+from functools import reduce + + +def gcd_list(n): +    return reduce(gcd, n) + + +def gcd(a, b): +    if b == 0: +        return a +    return gcd(b, a % b) + + -A = list(map(int, input().split())) -while True: -    if A.count(0) == n - 1: -        print((max(A))) -        exit() -    else: -        B = [_ for _ in A if _ != 0] -        attack = min(B) -        sn = A.index(attack) -        for i in range(n): -            if A[i] == 0: -                pass -            else: -                if i != sn: -                    A[i] = A[i] % attack -                else: -                    pass +a = list(map(int, input().split())) +print((gcd_list(a)))