import java.util.Scanner;
//最大公约数
public class s3 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int p[] = new int[n];
for (int i = 0; i < n; i++)
p[i] = sc.nextInt();
if (n == 1) {
System.out.println(p[0]);
return;
}
if (n == 2) {
System.out.println(gcd(p[0], p[1]));
return;
}
int m = gcdA(p, n);
System.out.println(m);
}
private static int gcdA(int[] p, int n) {
int a = p[0];
int b = p[1];
int c = gcd(a, b);
int i;
for (i = 2; i < n; i++) {
c = gcd(c, p[i]);
}
return c;
}
private static int gcd(int n, int m) {
if (n < m) {
n = m + n;
m = n - m;
n = n - m;
}
if (m == 0)
return n;
return gcd(m, n % m);
}
}
//边界问题
import java.util.Scanner;
public class s1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
long n = sc.nextLong();
long m = sc.nextLong();
long left = 240 - m;
if (left <= 0) {
System.out.println(0);
return;
}
long res = 0;
long i;
long nn = 0;
for (i = 1;; i++) {
res = 5 * i + res;
if (res == left) {
nn = i;
break;
} else if (res > left) {
nn=i-1;
break;
}
}
System.out.println(Math.min(nn, n));
}
}
}
//注意时间复杂度,全部秋和
import java.util.Scanner;
public class s2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
int p[] = new int[n];
int dp[] = new int[n];
for (int i = 0; i < n; i++){
p[i] = sc.nextInt();
if(i==0)
dp[i]=p[i];
else
dp[i] = dp[i - 1] + p[i];
}
int count = 0;
for (int i = 0; i < n - 1; i++) {
if (dp[i] * 2 == dp[n - 1]) {
count++;
}
}
System.out.println(count);
}
}
}