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

void main() {
  long n;
  readf("%d\n", &n);

  auto xs = readln.strip.split(" ").map!(to!long).array;
  xs = sort(xs).array;

  writeln(reduce!(gcd)(xs[0], xs));
}
