import math

n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in a:
    ans = math.gcd(ans, i)

print(ans) import math math 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 = 0 ans 0 for i in a:
    ans = math.gcd(ans, i) i a ans = math.gcd(ans, i) ans math.gcd(ans, i) math.gcd math gcd ans i print(ans) print ans a = list(map(int, input().split())) list(map(int, input().split())) a n = int(input()) int(input()) n ans = 0 0 ans ans = math.gcd(ans, i) math.gcd(ans, i) ans
import math

n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in a:
    ans = math.gcd(ans, i)

print(ans)
