#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"from fractions import*;input();a,*b=map(int,input().split())\n"
"for i in b:a=gcd(a,i)\n"
"print(a)\n"
"\"";
  system(s);
  return 0;
}            