#include <bits/stdc++.h>
using namespace std;
int make_min(int M, int m) {
  if (M % m == 0)
    return m;
  else
    return make_min(m, M % m);
}
int main() {
  int N;
  cin >> N;
  int A[N];
  int dp[N + 1];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  dp[1] = A[0];
  for (int i = 1; i < N; i++) {
    dp[i + 1] = make_min(dp[i], A[i]);
  }
  cout << dp[N] << endl;
  return 0;
}
