#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Graph= vector<vector<ll>>;
struct edge{ll to ; ll cost ;} ;
using graph =vector<vector<edge>> ;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
#define set20 cout<<fixed<<setprecision(20) ;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
double pi=acos(-1) ;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}



int main(){
  ll n ; cin>>n ;
  vector<ll> A(n) ;
  rep(i,n) cin>>A[i] ;
  ll ans= gcd(A[0],A[1]) ;
  rep(i,n-2){
    ans= gcd(ans,A[i+2]) ;
  }
  cout<<ans<<endl ;
    return 0 ;
}



#include <iostream>
#include <iomanip>
using namespace std;

int main(){
    int a=0;
    int b=0;
    int c=0;
    int d=0;
    int x=0;
    int y=0;
    int z=0;

    int n=0;
    int m=0;
    int i,j,k;
    int te=0;
    int A[100] ={0};
    int B[100] = {0};

    int AA[101][101];
    int BB[3][10];
    int CC[3][10];
    int DD[3][10];
    
    char op;
    char OP[100];
    long sum=0;
    double f1=0;
    double f2=0;

    cin >> x >>y >>z;
    //cin >> a;
    //cin >> a >> b;
    //cin >> a >> b >> c;
    //cin >> a>> b >> x >> y >> z;

    f1 = (double )y/x;
    b=(int)z*f1;
    f2 = (double)b/z;

    if(f2<f1){
        cout << b << endl;
        return 0;
    }
    if(f2 >= f1){
        for(i=b;i>=0;i--){
            f2 = (double)i/z;
            if(f2 < f1){
                break;
            }
        }
    }

    cout << i << endl;
    return 0;
}

