#!/usr/bin/env python
import sys 
import math
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))

ans = a[0]
for i in range(1, n): 
    ans = math.gcd(ans, a[i])

print(ans) import sys sys import math math input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = a[0] ans a[0] a 0 for i in range(1, n): 
    ans = math.gcd(ans, a[i]) i range(1, n) range 1 n ans = math.gcd(ans, a[i]) ans math.gcd(ans, a[i]) math.gcd math gcd ans a[i] a i print(ans) print ans ans = math.gcd(ans, a[i]) math.gcd(ans, a[i]) ans ans = a[0] a[0] ans n = int(input()) int(input()) n input = sys.stdin.readline sys.stdin.readline input a = list(map(int, input().split())) list(map(int, input().split())) a
#!/usr/bin/env python
import sys 
import math
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))

ans = a[0]
for i in range(1, n): 
    ans = math.gcd(ans, a[i])

print(ans)
