from math import *
n = int(input())
a = sorted(map(int, input().split()))
g = a[0]
for i in range(1,n):
  g = gcd(g, a[i])
print(g) from math import * n = int(input()) n int(input()) int input() input a = sorted(map(int, input().split())) a sorted(map(int, input().split())) sorted map(int, input().split()) map int input().split() ().split () input split g = a[0] g a[0] a 0 for i in range(1,n):
  g = gcd(g, a[i]) i range(1,n) range 1 n g = gcd(g, a[i]) g gcd(g, a[i]) gcd g a[i] a i print(g) print g g = gcd(g, a[i]) gcd(g, a[i]) g n = int(input()) int(input()) n a = sorted(map(int, input().split())) sorted(map(int, input().split())) a g = a[0] a[0] g
from math import *
n = int(input())
a = sorted(map(int, input().split()))
g = a[0]
for i in range(1,n):
  g = gcd(g, a[i])
print(g)