#include <iostream>
#include<fstream>
using namespace std;
int main()
{
	int n;
	ifstream fi("DQUC.inp");
	fi>>n;
	ofstream fo("DQUC.out");
	int m[n];
	for(int i=0;i<n;i++)
	{
		fi>>m[i];
	}
	int s1=m[0],s2;
	int ucln;
	for(int t=1;t<n;t++)
	{
		s2=m[t];
		while(s1!=s2)
		{
			if(s1<s2)
			{
				s2=s2-s1;
			}
			if(s1>s2)
			{
				s1=s1-s2;
			}
		}
		ucln=s1;
	}
	fo<<ucln;
	fi.close();
	fo.close();
}

