program ABC085C
    implicit none
    integer(8)::N,Y,i,j
    integer(8)::flg=0
    integer(8)::result(3)
    read(5,*)N,Y

    do i=0,N
        do j=0,N-i
            if(9*i+4*j==Y/1000-N)then
                flg=1
                result(1)=i
                result(2)=j
                result(3)=N-i-j
                exit
            end if
        end do
    end do

    if(flg==0)then
        print'(i0,1x,i0,1x,i0)',-1,-1,-1
    else
        print'(i0,1x,i0,1x,i0)',result(1),result(2),result(3)
    end if
end program ABC085C