program main
    read(*, *)n,m
    do i=0,n
       do j=0,n-i
          k = n - i - j
          if(i*10000 + j*5000 + k*1000 /= m)cycle
          write(*, *)i, j, k
          stop
       enddo
    enddo
    write(*, *) -1, -1, -1
end