#include <bits/stdc++.h>
using namespace std;
int n, s, ans, c[10], rem, tmp, y3, y4, y5, delta;
int gcd(int x, int y) { return (y == 0) ? x : gcd(y, x % y); }
int ex_gcd(int x, int y) {
  if (x % y == 0) return 0;
  int a = ex_gcd(y, x % y);
  return (1 - y * a) / (x % y);
}
void upd(int x3, int x4, int x5) {
  if (x3 > x4 || x4 > x5) return;
  int cnt = abs(x3 * c[3] - x4 * c[4]) + abs(x5 * c[5] - x4 * c[4]);
  if (ans == -1 || cnt <= ans) ans = cnt, y3 = x3, y4 = x4, y5 = x5;
}
int main() {
  int x, y, g;
  ans = -1;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    c[x]++;
  }
  g = gcd(c[3], c[5]);
  for (int w4 = 0; w4 * c[4] <= s; w4++) {
    rem = w4 * c[4];
    tmp = s - rem;
    if (tmp % g) continue;
    x = ex_gcd(c[3] / g, c[5] / g) * tmp / g % (c[5] / g);
    if (x < 0) x += c[5] / g;
    y = (tmp - x * c[3]) / c[5];
    if (x > w4 || y < w4) continue;
    upd(x, w4, y);
    if (c[3] * x > rem || rem > c[5] * y) continue;
    delta = min(rem - c[3] * x, c[5] * y - rem) / (c[3] / g * c[5]);
    delta = min(delta, min((w4 - x) / (c[5] / g), (y - x) / (c[3] / g)));
    x += delta * c[5] / g, y -= delta * c[3] / g;
    upd(x, w4, y);
    x += c[5] / g, y -= c[3] / g;
    upd(x, w4, y);
  }
  if (ans == -1)
    printf("-1\n");
  else
    printf("%d %d %d\n", y3, y4, y5);
  return 0;
}
