program prob2
    implicit none
    integer(8)::n, i, j, t, a, ans, tmp
    integer(8), allocatable::h(:)
    read(*,*) n, t, a
    a = a * 1000
    t = t * 1000
    tmp = 1e9
    allocate(h(n))
    read(*,*) h
    do i = 1, n
        if(abs(t - h(i) * 6 - a) < tmp) then
            ans = i
            tmp = abs(t - h(i) * 6 - a)
        end if
    end do
    print*, ans
    stop
end program