#include <bits/stdc++.h>
int main() {
  int i, j, h, s, n, a, f = 30000000, i1, j1, h1, c1 = 0, c2 = 0, c3 = 0;
  scanf("%d%d", &n, &s);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a == 3) c1++;
    if (a == 4) c2++;
    if (a == 5) c3++;
  }
  for (i = s / n; i >= 0; i--) {
    for (j = (s - i * c1) / (n - c1); j >= i; j--) {
      h = (s - c1 * i - c2 * j) / c3;
      if (h * c3 - j * c2 > f) break;
      if ((s - c1 * i - c2 * j) / c3 + 1 < j) break;
      if ((s - c1 * i - c2 * j) % c3 == 0) {
        if (i > j) break;
        if (j > h) break;
        if (abs(c1 * i - c2 * j) + abs(c3 * h - c2 * j) < f) {
          i1 = i;
          j1 = j;
          h1 = h;
          f = abs(c1 * i - c2 * j) + abs(c3 * h - c2 * j);
        }
      }
    }
  }
  if (f == 30000000)
    printf("-1\n");
  else
    printf("%d %d %d\n", i1, j1, h1);
  return 0;
}
