https://www.luogu.com.cn/problem/P4549
#include<bits/stdc++.h>
using namespace std;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int a[100005];
int main(void)
{
int n; cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
int ans=a[0];
for(int i=1;i<n;i++) {ans=gcd(ans,abs(a[i]));}
cout<<ans;
return 0;
}