#include <bits/stdc++.h>
using namespace std;
int Get() {
  char c;
  while (c = getchar(), c < '0' || c > '9')
    ;
  int X = 0;
  while (c >= '0' && c <= '9') {
    X = X * 10 + c - 48;
    c = getchar();
  }
  return X;
}
const int inf = 1000000000;
int main() {
  int N = Get(), S = Get(), a = 0, b = 0, c = 0;
  while (N--) {
    int X = Get();
    if (X == 3) a++;
    if (X == 4) b++;
    if (X == 5) c++;
  }
  int Ans = inf, Ans_x, Ans_y, Ans_z;
  for (int x = S / (a + b + c); x >= 0; x--) {
    int A = a * x;
    if (abs(S - 3 * A) / 2 >= Ans) continue;
    int Step = 1, Last = -1;
    for (int y = (S - A) / (b + c); y >= x; y -= Step) {
      int B = b * y, C = S - A - B, Temp = abs(A - B) + abs(B - C);
      if (B <= C && Temp >= Ans) break;
      if (!(C % c)) {
        if (Last != -1) Step = Last - y;
        Last = y;
        if (Temp < Ans) {
          Ans = Temp;
          Ans_x = x;
          Ans_y = y;
          Ans_z = C / c;
        }
      }
    }
  }
  if (Ans == inf)
    printf("-1\n");
  else
    printf("%d %d %d\n", Ans_x, Ans_y, Ans_z);
  return 0;
}
