
import math
N = int(input())
A = [int(x) for x in input().split()]

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

print(ans)

 import math math N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x A = [int(x) for x in input().split()] A [int(x) for x in input().split()] ans = A[0] ans A[0] A 0 for a in A[1:]:
    ans = math.gcd(a, ans) a A[1:] A 1: 1 ans = math.gcd(a, ans) ans math.gcd(a, ans) math.gcd math gcd a ans print(ans) print ans N = int(input()) int(input()) N ans = A[0] A[0] ans ans = math.gcd(a, ans) math.gcd(a, ans) ans A = [int(x) for x in input().split()] [int(x) for x in input().split()] A

import math
N = int(input())
A = [int(x) for x in input().split()]

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

print(ans)


