program gcd_on_blackboard
  implicit none
  integer :: n, a(100000), i, j, g, m
  a = 0
  read(*,*) n
  read(*,*) a(1:n)
  m = 1
  do j = 1, n
    g = a(1)
    if (j.eq.1) g = a(2)
    do i = 1, n
      if (i.eq.j) cycle
      if (g.le.m) exit
      g = gcd(a(i),g)
    end do
    if (m.lt.g) m = g
  end do
  write(*,'(i0)') m
  stop
contains
  recursive function gcd(n,m) result(g)
    implicit none
    integer, intent(in) :: n, m
    integer :: g
    if (n.lt.m) then
      g = gcd(m,n)
    else if (mod(n,m).eq.0) then
      g = m
    else
      g = gcd(m,mod(n,m))
    end if
  end function gcd
end program gcd_on_blackboard