'use strict'
const gcd = (m, n) => {
  if (n === 0) {
    return m
  } else {
    return gcd(n, m % n)
  }
}
function main(input) {
  input = input.split('\n').map(v => v.split(' ').map(v => ~~v))
  const n = input[0][0]
  const m = input[1].sort((a, b) => a - b)
  const sa = [0]
  let ans = m[0]
  for (let i = 1; i < n; i++) {
    ans = gcd(ans, m[i])
  }
  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))