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