read N Y
for (( x = 0; x <= N; x++ )); do
    Y0=$(( Y - x * 10000 - (N - x) * 1000 ))
    y=$(( Y0 / 4000 ))
    z=$(( N - x - y ))
    if (( y >= 0 && z >= 0 && Y0 % 4000 == 0 )); then
        echo ${x} ${y} ${z}
        exit
    fi
done
echo -1 -1 -1
