N=int(input())
A=map(int,input().split())
import math
from functools import reduce

print(reduce(math.gcd, A)) N=int(input()) N int(input()) int input() input A=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split import math math from functools import reduce print(reduce(math.gcd, A)) print reduce(math.gcd, A) reduce math.gcd math gcd A A=map(int,input().split()) map(int,input().split()) A N=int(input()) int(input()) N
N=int(input())
A=map(int,input().split())
import math
from functools import reduce

print(reduce(math.gcd, A))