#include <bits/stdc++.h>
int F(int c3, int c4, int c5, int k3, int k4, int k5) {
  return abs(c3 * k3 - c4 * k4) + abs(c4 * k4 - c5 * k5);
}
int main() {
  int now, temp, up;
  int n, s, x;
  int c3, c4, c5, k3, k4, k5, a, b, c;
  while (~scanf("%d%d", &n, &s)) {
    for (c3 = c4 = c5 = 0; n--;) {
      scanf("%d", &x);
      if (x == 3)
        c3++;
      else if (x == 4)
        c4++;
      else
        c5++;
    }
    c = -1;
    now = 987654321;
    for (k3 = s / (c3 + c4 + c5); k3 >= 0; k3--) {
      up = 987654321;
      for (k4 = (s - c3 * k3) / (c4 + c5); k4 >= k3; k4--) {
        k5 = s - c3 * k3 - c4 * k4;
        if (k5 % c5 == 0) {
          k5 /= c5;
          if (k5 < k4) break;
          temp = F(c3, c4, c5, k3, k4, k5);
          if (temp < up) {
            up = temp;
            if (temp < now) {
              now = temp;
              a = k3;
              b = k4;
              c = k5;
            }
          } else
            break;
        }
      }
    }
    if (c < 0)
      puts("-1");
    else
      printf("%d %d %d\n", a, b, c);
  }
  return 0;
}
