Option Strict On

Module Module1
    Sub Main()
        'let'
        Dim tmp() As Long =
            Array.ConvertAll(Of String, Long)(
                Split(Console.ReadLine()), AddressOf Long.Parse)
        Dim N As Long = tmp(0)
        Dim Y As Long = tmp(1)

        'var'
        Dim ans() As Long = New Long() {-1, -1, -1}
        Dim flg As Boolean

        For i As Long = 0 To N
            For j As Long = 0 To N - i
                Dim k As Long = N - i - j
                If 10 * i + 5 * j + k = Y \ CLng(10 ^ 3) Then
                    ans(0) = i
                    ans(1) = j
                    ans(2) = k
                    flg = True
                    Exit For
                End If
            Next
            If flg Then Exit For
        Next

        Console.WriteLine(
            Join(Array.ConvertAll(Of Long, String)(ans, AddressOf IntToStr)))

    End Sub

    Function IntToStr(ByVal i As Long) As String
        Return i.ToString()
    End Function

End Module
