'use strict'
function main(input) {
  input = input.trim().split('\n')
  const N = Number(input.shift())
  input = input[0].split(' ').map(v => Number(v)).sort((a, b) => a - b)

  let ans = input[0]
  for (let i = 1; i < N - 1; i++) {
    ans = input[i] % ans
    if (ans === 0) ans = input[i]
  }
  console.log(N, input, ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
