Module Module1

    Sub Main()
        Dim arr() As Integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine.Split(" "), AddressOf Integer.Parse)
        Dim n, y As Integer
        n = arr(0) : y = arr(1)
        Dim a As Integer = -1
        Dim b As Integer = -1
        Dim c As Integer = -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
