import math 
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
a = [int(i) for i in input().split()]
if 1 in a:
    ans = 1
else:
    ans = gcd_list(a)
print(ans) import math math from functools import reduce def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers *numbers def gcd_list(numbers):
    return reduce(math.gcd, numbers) gcd_list return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers numbers numbers def lcm_base(x, y):
    return (x * y) // math.gcd(x, y) lcm_base return (x * y) // math.gcd(x, y) (x * y) // math.gcd(x, y) x * y x y math.gcd(x, y) math.gcd math gcd x y x x y y def lcm(*numbers):
    return reduce(lcm_base, numbers, 1) lcm return reduce(lcm_base, numbers, 1) reduce(lcm_base, numbers, 1) reduce lcm_base numbers 1 *numbers def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1) lcm_list return reduce(lcm_base, numbers, 1) reduce(lcm_base, numbers, 1) reduce lcm_base numbers 1 numbers numbers n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] if 1 in a:
    ans = 1
else:
    ans = gcd_list(a) 1 in a 1 a ans = 1 ans 1 ans = gcd_list(a) ans gcd_list(a) gcd_list a print(ans) print ans def lcm_base(x, y):
    return (x * y) // math.gcd(x, y) def lcm_base(x, y):
    return (x * y) // math.gcd(x, y) lcm_base n = int(input()) int(input()) n def gcd(*numbers):
    return reduce(math.gcd, numbers) def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1) def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1) lcm_list a = [int(i) for i in input().split()] [int(i) for i in input().split()] a ans = 1 1 ans def lcm(*numbers):
    return reduce(lcm_base, numbers, 1) def lcm(*numbers):
    return reduce(lcm_base, numbers, 1) lcm ans = gcd_list(a) gcd_list(a) ans def gcd_list(numbers):
    return reduce(math.gcd, numbers) def gcd_list(numbers):
    return reduce(math.gcd, numbers) gcd_list
import math 
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
a = [int(i) for i in input().split()]
if 1 in a:
    ans = 1
else:
    ans = gcd_list(a)
print(ans)