import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        int paramN = sc.nextInt();
        int paramY = sc.nextInt();
        System.out.println(judgeOtoshidama(paramN, paramY));
        sc.close();
    }

    public static String judgeOtoshidama(int N, int Y){
        for(int cnt10=0; cnt10<=N; cnt10++){
            for(int cnt5=0; cnt5<=N-cnt10; cnt5++){
                int cnt1 = N - (cnt10 + cnt5);
                if(Y == (cnt10 * 10000 + cnt5 * 5000 + cnt1 * 1000)){
                    return cnt10 + " " + cnt5 + " " + cnt1;
                }
            }
        }
        return "-1 -1 -1";
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz