import numpy as np

i = eval(input())

N = list(set(map(int, input().split(' '))))

def one_turn(l):

  l.sort()

  n = l[0]

  return np.array(list(set([n]+[ l[i]%n for i in range(1,len(l)) if ((l[i]%n != 0))])))



if len(set(N)) == 1 :

  print((N[0]))

else :

  N = np.array(N)

  while True :

    N = one_turn(N)

    if N[0] == 1 :

      print((1))

      break

    if len(N) == 1 :

      print((N[0]))

      break
import numpy as np



N= int(eval(input()))



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

A.sort()



def gcd(a,b):

  if b==0:

    return a

  else:

    return gcd(b,a%b)

  



r = 0

for i in A:

  r = gcd(i,r)

print(r)

  
import numpy as np

i = eval(input())
N = list(set(map(int, input().split(" "))))


def one_turn(l):
    l.sort()
    n = l[0]
    return np.array(
        list(set([n] + [l[i] % n for i in range(1, len(l)) if ((l[i] % n != 0))]))
    )


if len(set(N)) == 1:
    print((N[0]))
else:
    N = np.array(N)
    while True:
        N = one_turn(N)
        if N[0] == 1:
            print((1))
            break
        if len(N) == 1:
            print((N[0]))
            break

import numpy as np

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()


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


r = 0
for i in A:
    r = gcd(i, r)
print(r)

-i = eval(input()) -N = list(set(map(int, input().split(" ")))) +N = int(eval(input())) +A = list(map(int, input().split())) +A.sort() -def one_turn(l): -    l.sort() -    n = l[0] -    return np.array( -        list(set([n] + [l[i] % n for i in range(1, len(l)) if ((l[i] % n != 0))])) -    ) +def gcd(a, b): +    if b == 0: +        return a +    else: +        return gcd(b, a % b) -if len(set(N)) == 1: -    print((N[0])) -else: -    N = np.array(N) -    while True: -        N = one_turn(N) -        if N[0] == 1: -            print((1)) -            break -        if len(N) == 1: -            print((N[0])) -            break +r = 0 +for i in A: +    r = gcd(i, r) +print(r)