import std.stdio;
import std.algorithm;
import std.conv;
import std.string;
import std.array;
import std.math;

void main(){
  readln();
  int[] monster = readln().chomp.split.map!(to!int).array;
  int min_mon;

  while(true){
    monster = monster.uniq.array;
    if(monster.length == 1){break;}
    min_mon = monster.reduce!min;
    monster = monster.map!(x=>x%min_mon==0?min_mon:x%min_mon).array;
  }

  monster[0].writeln;
}