#include <fstream>
#include <vector>

using namespace std;

int GCD(int a, int b)
{
	return (b == 0) ? a : GCD(b, a % b);
}

int main()
{
	ifstream input("DQUC.inp");
	ofstream output("DQUC.out");

	int n;
	int a;
	int res = -1;
	input >> n;
	for (int i = 0; i < n; i++)
	{
		input >> a;
		if (res != -1)
		{
			res = GCD(a, res);
		}
		else
		{
			res = a;
		}
	}
	output << res;
	input.close();
	output.close();
	return 0;
}