'use strict';
const main = input => {
  const battle = (a, b) => {
    if(a%b==0) return b;
    return battle(b, a%b);
  } 
  const n = parseInt(input[0], 10), a = input[1].split(' ').map(val => parseInt(val, 10));
  // console.log(n, a);
  while(a.length != 1) {
    a[1] = battle(a[0], a[1]);
    a.shift();
  }
  // for (let i = 0; i < n-1; i++) {
  //   a[1] = battle(a[0], a[1]);
  //   a.shift();
  // }
  console.log(a[0]);
  
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));