#include <bits/stdc++.h>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
/*
struct Edge
{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w) {}
};
using Graph = vector<vector<Edge>>;
*/
using Graph = vector<vector<int>>;

const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1}, dy[8] = {-1, 0, 1, 1, -1, 1, 0, -1};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    vector<ll> a(N);
    for (auto &it : a)
        cin >> it;

    ll ans = a[0];
    for (int i = 1; i < N; i++)
    {
        ans = gcd(ans, a[i]);
    }
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>
#include <sstream>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

/*
0のアスキー　"48"
*/

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) x.begin(),x.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))


int main(){

    ll N;
    cin >> N;

    vector<ll> A(N);

    for(ll i = 0;i < N;i++)
        cin >> A.at(i);

    ll min = MOD;
    for(ll i = 0;i < N;i++){
        if(min > A.at(i))
            min =  A.at(i);
    }     

    if(min == 1){
        cout << min << endl;
    }else{
        while(1){
        bool zero_fla = true;
        ll hako = MOD;
        for(ll i = 0;i < N;i++){
            A.at(i) %= min;
            if(A.at(i) != 0 and hako > A.at(i)){
                zero_fla = false;
                hako = A.at(i);
            }
        }

        if(min > hako)
            min = hako;

        if(zero_fla or min == 1)
            break;

        }

        cout << min << endl;
    }

    
    return 0;

}