import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

import functools
print(functools.reduce(gcd, a)) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 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):
    if b == 0:
        return a
    else:
        return gcd(b, a % b) gcd if b == 0:
        return a
    else:
        return gcd(b, a % b) b == 0 b 0 return a a return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b a a b b import functools functools print(functools.reduce(gcd, a)) print functools.reduce(gcd, a) functools.reduce functools reduce gcd a def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b) def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b) gcd input = sys.stdin.readline sys.stdin.readline input n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

import functools
print(functools.reduce(gcd, a))
