import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.stream.Stream;

public class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.PrintWriter; PrintWriter java.io import java.util.stream.Stream; Stream java.util.stream public class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  }
} Main public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) String s = br.readLine(); s br.readLine() br.readLine br String[] sa = s.split(" "); sa s.split(" ") s.split s " " int n = Integer.parseInt(sa[0]); n Integer.parseInt(sa[0]) Integer.parseInt Integer sa[0] sa 0 int y = Integer.parseInt(sa[1]); y Integer.parseInt(sa[1]) Integer.parseInt Integer sa[1] sa 1 int yukichi = -1; yukichi -1 1 int ichiyou = -1; ichiyou -1 1 int hideyo = -1; hideyo -1 1 for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    } int a = 0; int a = 0; a 0 a <= n a n a++ a++ a {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    } {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    } for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      } int b = 0; int b = 0; b 0 b <= n -a b n -a n a b++ b++ b {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      } {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      } int c = n - a - b; c n - a - b n - a - b n a b int total = 10000*a + 5000*b + 1000*c; total 10000*a + 5000*b + 1000*c 10000*a + 5000*b + 1000*c 10000*a 10000 a 5000*b 5000 b 1000*c 1000 c if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        } total == y total y {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        } yukichi = a yukichi a ichiyou = b ichiyou b hideyo = c hideyo c out.println(yukichi + " " + ichiyou + " " + hideyo) out.println out yukichi + " " + ichiyou + " " + hideyo " " ichiyou yukichi + " " + ichiyou + " " + hideyo yukichi " " ichiyou " " hideyo out.close() out.close out String[] args args public class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  }
} public class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.stream.Stream;

public class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    String s = br.readLine();
    String[] sa = s.split(" ");
    int n = Integer.parseInt(sa[0]);
    int y = Integer.parseInt(sa[1]);
    int yukichi = -1;
    int ichiyou = -1;
    int hideyo = -1;
    for (int a = 0; a <= n; a++) {
      for (int b = 0; b <= n -a; b++) {
        int c = n - a - b;
        int total = 10000*a + 5000*b + 1000*c;
        if (total == y) {
          yukichi = a;
          ichiyou = b;
          hideyo = c;
        }
      }
    }
    out.println(yukichi + " " + ichiyou + " " + hideyo);
    out.close();
  }
}