program answer
  implicit none
  integer(16) :: i, N, mi, ans, z
  integer(16), allocatable :: A(:)
  read(*,*) N
  allocate(A(N))
  read(*,*) A

  ans=10**9
  do i = 1, N-1
     call gcd(A(i),A(i+1),z)
     ans=min(ans,z)
  end do

  write(*,*) ans
  deallocate(A)
  stop
contains
  subroutine gcd(x,y,ans)
    implicit none
    integer(16) :: i, x, y, ans, a, b, c
    if(x<y) then
       a=y
       y=x
       x=a
    end if
    a=x
    b=y
    do
       if(mod(a,b)==0) then
          ans=b
          exit
       end if
       c=b
       b=mod(a,b)
       a=c
    end do
    end subroutine gcd
 end program answer