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