implicit none
integer:: n,y,i,j,k
 
read(*,*) n,y
 
do i=0,n
do j=0,n
do k=0,n
if(i+j+k==n.and.10000*i+5000*j+1000*k==y)then
write(*,*) i,j,k
goto 100
endif
end do
end do
end do
 
write(*,*) -1,-1,-1
 
100 end