#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1001001001;
const long long MOD = 1000000007;
const double EPS = 1e-10;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin>>n;
    int a[n],minv=INF,maxv=-1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        minv=min(minv,a[i]);
        maxv=max(maxv,a[i]);
    }
    int preV=minv;
    while(1){
        for(int i=0;i<n;i++)a[i]%=minv;
        minv=INF;
        for(int i=0;i<n;i++){
            if(a[i]==0)continue;
            minv=min(minv,a[i]);
        }
        if(minv==INF){
            cout<<preV<<endl;
            return 0;
        }
        preV=minv;
    }
}
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false);    cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define mp(i,j) make_pair(i,j)
typedef long long ll;
const int maxn = 1e3+5;
vector<int> vec;
vector<int> pre;

int gcd(int x,int y){
    return y? gcd(y,x%y) : x;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n;  cin >> n;
    int now = 0;
    for(int i = 0; i < n; ++i){
        int x;  cin >> x;
        now = gcd(now,x);
    }cout<<now << endl;
    return 0;
}
