program sample
    implicit none
    character(100)::s
    integer(8) :: i,j,k,m,n,t
    integer(8)::a,b,c,d,ans
    integer(8),allocatable::x(:),y(:)
  
    read(*,*)n 
    read(*,*)t,a
    allocate(x(n))
    read(*,*)x
    t=1000*t
    a=1000*a
    do i=1,n
       if(abs(t-6*x(i)-a)<m)then
            m=abs(t-6*x(i)-a)
            ans=i
       end if
    end do
    write(*,*)ans
    stop
end program sample
  

