Module Module1

    Sub Main()
        Dim arr() As Integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
        Dim N As Integer = arr(0)
        Dim Y As Integer = arr(1)
        Dim a, b, c As Integer
        a = -1 : b = -1 : c = -1
        For i As Integer = 0 To N
            For j As Integer = 0 To N
                Dim k As Integer = N - i - j
                If k >= 0 AndAlso i * 10000 + j * 5000 + k * 1000 = Y Then
                    a = i : b = j : c = k
                End If
            Next
        Next

        Console.WriteLine(a.ToString + " " + b.ToString + " " + c.ToString)
    End Sub

End Module