import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
    
    public static int beamSearch(long[] arr, long target){
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
    
    public static int beamSearch(long[] arr, long target){
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    }
} Main public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    } main {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    } FastScanner sc = new FastScanner(System.in); sc new FastScanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        } {
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        } for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            } int j = 0; int j = 0; j 0 j <= n-i j n-i n i j++ j++ j {
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            } {
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            } int z = n-i-j; z n-i-j n-i-j n i j int zy = y-10000*i-5000*j; zy y-10000*i-5000*j y-10000*i-5000*j y 10000*i 10000 i 5000*j 5000 j if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                } (z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000) (z == 0 && zy == 0) z == 0 z 0 zy == 0 zy 0 (z != 0 && zy % z == 0 && zy/z == 1000) z != 0 && zy % z == 0 && zy/z == 1000 z != 0 z 0 zy % z == 0 zy % z zy z 0 zy/z == 1000 zy/z zy z 1000 {
                    System.out.println(i + " " + j + " " + z);
                    return;
                } System.out.println(i + " " + j + " " + z) System.out.println System.out System System.out i + " " + j + " " + z " " j i + " " + j + " " + z i " " j " " z return; System.out.println("-1 -1 -1") System.out.println System.out System System.out "-1 -1 -1" String[] args args public static int beamSearch(long[] arr, long target){
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    } beamSearch {
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    } int left = 0; left 0 int right = arr.length; right arr.length arr arr.length while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        } right-left > 1 right-left right left 1 {
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        } int mid = (left+right)/2; mid (left+right)/2 (left+right) left right 2 if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            } arr[mid] > target arr[mid] arr mid target {
                right = mid;
            } right = mid right mid {
                left = mid;
            } left = mid left mid return left; left long[] arr arr long target target class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
} FastScanner private BufferedReader reader = null; reader null private StringTokenizer tokenizer = null; tokenizer null public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    } FastScanner {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    } reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) tokenizer = null tokenizer null InputStream in in public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    } next {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (IOException e) {
                throw new RuntimeException(e);
            } IOException e {
                throw new RuntimeException(e);
            } throw new RuntimeException(e); new RuntimeException(e) {
                tokenizer = new StringTokenizer(reader.readLine());
            } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    } nextLine {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (IOException e) {
                throw new RuntimeException(e);
            } IOException e {
                throw new RuntimeException(e);
            } throw new RuntimeException(e); new RuntimeException(e) {
                return reader.readLine();
            } return reader.readLine(); reader.readLine() reader.readLine reader return tokenizer.nextToken("\n"); tokenizer.nextToken("\n") tokenizer.nextToken tokenizer "\n" public long nextLong() {
        return Long.parseLong(next());
    } nextLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public int nextInt() {
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() {
         return Double.parseDouble(next());
    } nextDouble {
         return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    } nextIntArray {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    } int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
            a[i] = nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } nextLongArray {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
            a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
    
    public static int beamSearch(long[] arr, long target){
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
    
    public static int beamSearch(long[] arr, long target){
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    }
} Main
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n-i; j++){
                int z = n-i-j;
                int zy = y-10000*i-5000*j;
                if((z == 0 && zy == 0) || (z != 0 && zy % z == 0 && zy/z == 1000)){
                    System.out.println(i + " " + j + " " + z);
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
    
    public static int beamSearch(long[] arr, long target){
        int left = 0;
        int right = arr.length;
        while(right-left > 1){
            int mid = (left+right)/2;
            if(arr[mid] > target){
                right = mid;
            }else{
                left = mid;
            }
        }
        return left;
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
