#include <stdio.h>
int GCD(int a,int b);
int main(int argc, const char * argv[]) {
int n,i,people,temp;
while (scanf("%d",&n)!=EOF) {
scanf("%d",&temp);
for(i=1;i<n;i++){
scanf("%d",&people);
if(people>=temp){
temp=GCD(people,temp);
}else{
temp=GCD(temp,people);
}
}
printf("%d\n",temp);
}
return 0;
}
int GCD(int a,int b){//a>b
if(b){
return GCD(b,a%b);
}else{
return a;
}
}