#include <bits/stdc++.h>
using namespace std;
ifstream f1("DQUC.INP");
ofstream f2("DQUC.OUT");
int ucln(int a, int b)
{
    while (a!=b)
    {if (a>b)
        {
            a=a-b;
        }
        else b=b-a;
    }
    return a;
}

int main()
{

      int n,i,uc;
   f1>>n;
   int a[n+1];
for (i=1;i<=n;i++)
   {
       f1>>a[i];
   }
   uc=ucln(a[1],a[2]);
   for (i=3;i<=n;i++)
   {
       uc=ucln(uc,a[i]);
   }
   f2<<uc;
   return 0;
}
