program tenquestioneight
implicit none
integer N, Y, i, j, k
read(*,*) N, Y
 do i=0,2000
  do j=0,N-i
  k=N-i-j
   if ((10000*i+5000*j+k*1000).eq.Y) then
   write(*,*) i, j, k
   return
   end if
   if ((10000*i+5000*j).gt.Y) exit
  end do
 if ((10000*i).gt.Y) exit
 end do
write(*,*) -1, -1, -1
end program