read N Y
(( Y /= 1000 ))
for (( z = Y % 5; z <= N; z += 5 )); do
    x5=$(( Y + 4 * z - N * 5 ))
    x=$(( x5 / 5 )) y=$(( N - x - z ))
    (( x >= 0 && y >= 0 )) && echo $x $y $z && exit
done
echo -1 -1 -1
