import math

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

ans = nums[0]
for n in nums[1:]:
    ans = math.gcd(ans, n)
print(ans) import math math n = int(input()) n int(input()) int input() input nums = list(map(int, input().split())) nums list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = nums[0] ans nums[0] nums 0 for n in nums[1:]:
    ans = math.gcd(ans, n) n nums[1:] nums 1: 1 ans = math.gcd(ans, n) ans math.gcd(ans, n) math.gcd math gcd ans n print(ans) print ans ans = nums[0] nums[0] ans ans = math.gcd(ans, n) math.gcd(ans, n) ans n = int(input()) int(input()) n nums = list(map(int, input().split())) list(map(int, input().split())) nums
import math

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

ans = nums[0]
for n in nums[1:]:
    ans = math.gcd(ans, n)
print(ans)
