from sys import stdin

import numpy as np

#import math as math

import fractions as math





N = int(stdin.readline())

A = list(map(int,stdin.readline().strip().split()))



ans = A[0]

for i in range(1,N):

    ans = math.gcd(ans,A[i])



print(ans)
from sys import stdin



def gcd(a, b):

    while b:

        a, b = b, a % b

    return a



N = int(stdin.readline())

A = list(map(int,stdin.readline().strip().split()))



ans = A[0]

for i in range(1,N):

    ans = gcd(ans,A[i])



print(ans)

from sys import stdin
import numpy as np

# import math as math
import fractions as math

N = int(stdin.readline())
A = list(map(int, stdin.readline().strip().split()))
ans = A[0]
for i in range(1, N):
    ans = math.gcd(ans, A[i])
print(ans)

from sys import stdin


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


N = int(stdin.readline())
A = list(map(int, stdin.readline().strip().split()))
ans = A[0]
for i in range(1, N):
    ans = gcd(ans, A[i])
print(ans)

-import numpy as np -# import math as math -import fractions as math + +def gcd(a, b): +    while b: +        a, b = b, a % b +    return a + -    ans = math.gcd(ans, A[i]) +    ans = gcd(ans, A[i])