#include <bits/stdc++.h>
using namespace std;
int n, s, c[3], w[3], pt[3], ans = 0x7f7f7f7f;
void exgcd(int a, int b, int &GCD, int &x, int &y) {
  if (!b) {
    GCD = a, x = 1, y = 0;
  } else
    exgcd(b, a % b, GCD, y, x), y -= a / b * x;
}
void checkmin() {
  int tmp = abs(w[0] * c[0] - w[1] * c[1]) + abs(w[1] * c[1] - w[2] * c[2]);
  if (tmp < ans) ans = tmp, pt[0] = w[0], pt[1] = w[1], pt[2] = w[2];
}
void ser() {
  int tmp = c[1] * w[1], x, y, gcd;
  exgcd(c[0], c[2], gcd, x, y);
  if ((s - tmp) % gcd) return;
  x *= (s - tmp) / gcd;
  int res = c[2] / gcd;
  x = (x % res + res) % res;
  int L = 0, R = s / res + 10, Mid;
  while (L < R) {
    Mid = (L + R + 1) >> 1;
    int rec = Mid * res + x;
    w[2] = (s - tmp - rec * c[0]) / c[2];
    if (rec <= w[1] && res * c[0] <= tmp && w[2] >= w[1] && w[2] * c[2] >= tmp)
      L = Mid;
    else
      R = Mid - 1;
  }
  w[0] = L * res + x;
  w[2] = (s - tmp - w[0] * c[0]) / c[2];
  if (w[0] <= w[1] && w[1] <= w[2]) checkmin();
  w[0] += res;
  w[2] -= c[0] / gcd;
  if (w[0] <= w[1] && w[1] <= w[2]) checkmin();
}
int main() {
  scanf("%d%d", &n, &s);
  for (int u, i = 1; i <= n; i++) {
    scanf("%d", &u);
    c[u - 3]++;
  }
  for (int i = 0; i <= s / c[1] + 1; i++) {
    w[1] = i;
    ser();
  }
  if (ans == 0x7f7f7f7f)
    printf("-1");
  else
    printf("%d %d %d\n", pt[0], pt[1], pt[2]);
}
