# 最大公約数(mathは3.5以降) 
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))

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 import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 ans =gcd_list(A) ans gcd_list(A) gcd_list A print(ans) print ans input = sys.stdin.readline sys.stdin.readline input ans =gcd_list(A) gcd_list(A) ans A = list(map(int, input().split())) list(map(int, input().split())) A def gcd(*numbers):
    return reduce(math.gcd, numbers) def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd def gcd_list(numbers):
    return reduce(math.gcd, numbers)

# 初期入力 def gcd_list(numbers):
    return reduce(math.gcd, numbers)

# 初期入力 gcd_list N = int(input()) int(input()) N
# 最大公約数(mathは3.5以降) 
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))

ans =gcd_list(A)
print(ans)
