// ユークリッドの互除法
func gcd(_ x: Int, _ y: Int) -> Int {
    if y == 0 { return x }
    return gcd(y, x % y)
}
// 再帰関数
func recursiveFunc(_ idx: Int, _ x: Int) {
    if idx == N-1 {
        print(x)
        return
    }
    recursiveFunc(idx+1, gcd(x, A[idx+1]))
}

let N = Int(readLine()!)!
let A: [Int] = readLine()!.split(separator: " ").map { Int($0)! }

recursiveFunc(1, gcd(A[0], A[1]))   // (๑•ૅㅁ•๑)