import fractions
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = fractions.gcd(ans, a[i])
print(ans) import fractions fractions 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 = fractions.gcd(ans, a[i]) i range(1, N) range 1 N ans = fractions.gcd(ans, a[i]) ans fractions.gcd(ans, a[i]) fractions.gcd fractions gcd ans a[i] a i print(ans) print ans ans = a[0] a[0] ans a = list(map(int, input().split())) list(map(int, input().split())) a ans = fractions.gcd(ans, a[i]) fractions.gcd(ans, a[i]) ans N = int(input()) int(input()) N
import fractions
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = fractions.gcd(ans, a[i])
print(ans)