#include <stdio.h>

int GCD(int a, int b){
  int r; 
  while(b!=0){
    r = a % b;
    a = b;
    b = r;    
  }    
  return a; 
} 

int main() {
	
  int n, gcd, num, i; 
  scanf("%d%d", &n, &gcd);
  
  for(i=1; i<n; i++){
    scanf("%d", &num);
    gcd = GCD(num, gcd);    
  }
  printf("%d", gcd);
   
  return 0;
}

