#include <iostream>
using namespace std;
unsigned long long gcd(unsigned long long m, unsigned long long n)
{
return (n != 0) ? gcd(n, m%n) : m;
}
int main()
{
unsigned long long m, n, result;
cin >> m >> result;
for (unsigned long long i = 2; i <= m; i++)
{
cin >> n;
result = gcd(result, n);
if (result == 1) m = 1; //same as break
}
cout << result << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdW5zaWduZWQgbG9uZyBsb25nIGdjZCh1bnNpZ25lZCBsb25nIGxvbmcgbSwgdW5zaWduZWQgbG9uZyBsb25nIG4pCnsKCXJldHVybiAobiAhPSAwKSA/IGdjZChuLCBtJW4pIDogbTsKfQoKaW50IG1haW4oKQp7Cgl1bnNpZ25lZCBsb25nIGxvbmcgbSwgbiwgcmVzdWx0OwoJY2luID4+IG0gPj4gcmVzdWx0OwoJZm9yICh1bnNpZ25lZCBsb25nIGxvbmcgaSA9IDI7IGkgPD0gbTsgaSsrKQoJewoJCWNpbiA+PiBuOwoJCXJlc3VsdCA9IGdjZChyZXN1bHQsIG4pOwoJCWlmIChyZXN1bHQgPT0gMSkgbSA9IDE7IC8vc2FtZSBhcyBicmVhawoJfQoJY291dCA8PCByZXN1bHQgPDwgZW5kbDsKCXJldHVybiAwOwp9