/*
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College
    Date:13/06/2020
*/
#include<bits/stdc++.h>
#include<string>
#include<algorithm>
using namespace std;
#define ll long long
#define int long long
#define ld long double
#define ff first
#define clr(a,x) memset(a,x,sizeof(a))
#define ss string 
#define se second
#define alt(v) v.begin(),v.end()
#define pb emplace_back
#define mp make_pair
#define ipair pair<int,int>
#define fab(i,a,b) for(ll i=(a);i<(b);i++)
#define fba(i,a,b) for(ll i=(b);i>=(a);i--)
#define arr(i,n) fab(i,0,n)
ll mod=1000000007;
// int mod = 998244353;
int dx[]={-1,1,0,0};
int dy[]={0,0,1,-1};
void DBG() {
    cerr << "]" << endl;
}
template<class H, class... T> void DBG(H h, T... t) {
    cerr << to_string(h);
    if(sizeof...(t))
        cerr << ", ";
    DBG(t...);
}
#ifdef _DEBUG
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif










const int inf = 1e18;
bool test = 0;
const int N = 1e5+5;



int n,x;

void solve()
{
    cin >>n;
    set<int>st;
    for(int i = 1; i <= n; ++i)
    {
        cin >>x;
        st.insert(x);
    }

    while(st.size() > 1){
        int mnx = *st.begin();
        int mx = *st.rbegin();
        st.erase(mx);
        st.insert(mx-mnx);
    }
    cout<<*st.begin()<<"\n";


}













clock_t startTime;
double getCurrentTime() {
    return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}

signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int t=1;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    // precompute();
    if(test)
        cin>>t;
    while(t--)
    {
        solve();
    }
    DBG(getCurrentTime());
    return 0;
}
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int n;
int arr[100010];

bool judge(int k) {
    for(int i=1; i<=n; i++)
        if(arr[i] % k != 0)
            return false;
    return true;
}

int main() {
    int ans = 1;
    cin >> n;
    for(int i=1; i<=n; i++)
        cin >> arr[i];
    sort(arr+1, arr+n+1);
    for(int i=2; i<=arr[1]; i++)
        if(judge(i))
            ans = i;
    cout << ans;
    return 0;
}


