from fractions import gcd

import numpy as np



N = int(eval(input()))

A = np.array([int(i) for i in input().split()])



a = A[0]

for b in A[1:]:

  # print(a)

  a = gcd(a, b)



print(a)
def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a%b)



def main():

    N = int(eval(input()))

    An = list(map(int, input().split(' ')))





    An = sorted(An)

    An = [gcd(a_n, An[0]) for a_n in An]

    print((min(An)))



main()
from fractions import gcd
import numpy as np

N = int(eval(input()))
A = np.array([int(i) for i in input().split()])
a = A[0]
for b in A[1:]:
    # print(a)
    a = gcd(a, b)
print(a)

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


def main():
    N = int(eval(input()))
    An = list(map(int, input().split(" ")))
    An = sorted(An)
    An = [gcd(a_n, An[0]) for a_n in An]
    print((min(An)))


main()

-from fractions import gcd -import numpy as np +def gcd(a, b): +    if b == 0: +        return a +    return gcd(b, a % b) -N = int(eval(input())) -A = np.array([int(i) for i in input().split()]) -a = A[0] -for b in A[1:]: -    # print(a) -    a = gcd(a, b) -print(a) + +def main(): +    N = int(eval(input())) +    An = list(map(int, input().split(" "))) +    An = sorted(An) +    An = [gcd(a_n, An[0]) for a_n in An] +    print((min(An))) + + +main()