#include <bits/stdc++.h>
using namespace std;
int n, s, c3, c4, c5, minn = 0x7f7f7f7f, ans3, ans4, ans5;
int f(int x, int y, int z) {
  return abs(c3 * x - c4 * y) + abs(c4 * y - c5 * z);
}
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    if (x == 3) c3++;
    if (x == 4) c4++;
    if (x == 5) c5++;
  }
  for (int k3 = s / n; k3 >= 0; k3--)
    for (int k4 = (s - k3 * c3) / (n - c3); k4 >= k3; k4--) {
      int k5 = (s - k3 * c3 - k4 * c4) / c5;
      if (k5 * c5 - k4 * c4 >= minn) break;
      int tmp = f(k3, k4, k5);
      if (k3 * c3 + k4 * c4 + k5 * c5 == s && tmp < minn)
        minn = tmp, ans3 = k3, ans4 = k4, ans5 = k5;
    }
  if (minn != 0x7f7f7f7f)
    printf("%d %d %d", ans3, ans4, ans5);
  else
    puts("-1");
}
