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

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

for i in range(1, n):
    A[i] = gcd(A[i-1], A[i])
print(A[-1]) n = int(input()) n int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def gcd(a, b):
    while b != 0:
        c = a%b
        a = b
        b = c
    return a gcd while b != 0:
        c = a%b
        a = b
        b = c
     b != 0 b 0 c = a%b c a%b a b a = b a b b = c b c return a a a a b b for i in range(1, n):
    A[i] = gcd(A[i-1], A[i]) i range(1, n) range 1 n A[i] = gcd(A[i-1], A[i]) A[i] A i gcd(A[i-1], A[i]) gcd A[i-1] A i-1 i 1 A[i] A i print(A[-1]) print A[-1] A -1 n = int(input()) int(input()) n def gcd(a, b):
    while b != 0:
        c = a%b
        a = b
        b = c
    return a def gcd(a, b):
    while b != 0:
        c = a%b
        a = b
        b = c
    return a gcd A = list(map(int, input().split())) list(map(int, input().split())) A
n = int(input())
A = list(map(int, input().split()))

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

for i in range(1, n):
    A[i] = gcd(A[i-1], A[i])
print(A[-1])