#import <stdio.h>
#import <stdlib.h>
#if !defined(MIN)
#define MIN(A,B)    ((A) < (B) ? (A) : (B))
#endif

#if !defined(MAX)
#define MAX(A,B)    ((A) > (B) ? (A) : (B))
#endif

int gcd(int a, int b){
    int M = MAX(a, b);
    int m = MIN(a, b);
    
    if (m == 0) {
        return M;
    }
    int r = M % m;
    if (r==0) return m;
    else return gcd(r,m);
}

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        int N;
        scanf("%d", &N);
        int *numbers = (int*)malloc(N * sizeof(int));
        
        int n;
        int i = 0;
        while (scanf("%d", &n) != EOF) {
            numbers[i] = n;
            i++;
        }
        
        int g = numbers[0];
        for(int i=1;i<N;i++){
            g=gcd(numbers[i],g);
        }
        printf("%d\n",g);

        free(numbers);
    }
    return 0;
}
