      PROGRAM otoshidama
      IMPLICIT NONE
      INTEGER :: N,Y
      INTEGER :: a,b,c, s,ans(3)
      LOGICAL :: flag
      !a10000 b5000 c1000
      
      READ*,N ,Y
      
      flag = .FALSE.
      
      outer:DO a = 0,N
        DO b = 0,N-a
          c = N - a - b
          s = 10000*a + 5000*b + 1000*c
          IF(s==Y)THEN
            flag = .TRUE.
            ans(1)=a;ans(2)=b;ans(3)=c
          END IF
        END DO
      END DO outer
      
      IF(flag)THEN
        print'(I0,X,I0,X,I0)',ans(:)
      ELSE
        print'(A)','-1 -1 -1'
      END IF
      
      
      
      
      
      
      END PROGRAM