#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 1e18;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(v) v.begin(),v.end()

ll GCD(ll a, ll b) {
	if(a<b) swap(a,b);
	ll r=a%b;
	while(r!=0){
		a=b;
		b=r;
		r=a%b;
	}
	return b;
}

int main(){
	int n; cin >> n;
	VI a(n); REP(i,n) cin >> a[i];
	ll ans=a[0];
	REP(i,n){
		ans=GCD(ans,a[i]);
	}
	cout << ans << endl;
	return 0;
}
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=1e5+100;
int a[maxn],n;
int num1=0x3f3f3f3f;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		num1=min(num1,a[i]);
	}
	while(1){
		int y=num1;
		for(int i=1;i<=n;i++){
			if(a[i]%num1==0) a[i]=num1;
			else{
				int x=a[i]%num1;
				a[i]=x;
				num1=x;
			}
		}
		if(y==num1)
		{
			printf("%d\n",y);
			break;
		}
	}
}