import math

N=int(input())
S=list(map(int,input().split()))
F=S[0]
for i in range(N-1):
    F=math.gcd(F,S[i+1])

print(F) import math math N=int(input()) N int(input()) int input() input S=list(map(int,input().split())) S list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split F=S[0] F S[0] S 0 for i in range(N-1):
    F=math.gcd(F,S[i+1]) i range(N-1) range N-1 N 1 F=math.gcd(F,S[i+1]) F math.gcd(F,S[i+1]) math.gcd math gcd F S[i+1] S i+1 i 1 print(F) print F F=math.gcd(F,S[i+1]) math.gcd(F,S[i+1]) F N=int(input()) int(input()) N F=S[0] S[0] F S=list(map(int,input().split())) list(map(int,input().split())) S
import math

N=int(input())
S=list(map(int,input().split()))
F=S[0]
for i in range(N-1):
    F=math.gcd(F,S[i+1])

print(F)