#include <bits/stdc++.h>
using namespace std;
const int N = 305;
int A[N], f[3], n, s;
inline int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; ++i) scanf("%d", A + i), ++f[A[i] - 3];
  int res(~0u >> 1), ri, rk, rj;
  for (int i = s / n; i >= 0; --i) {
    if ((s - i * f[0]) % gcd(f[1], f[2])) continue;
    for (int j = (s - i * f[0]) / (f[1] + f[2]); j >= i; --j) {
      int k = (s - i * f[0] - j * f[1]) / f[2];
      int w1 = k * f[2] - j * f[1], w2 = i * f[0] - j * f[1];
      if (w1 > res || w2 > res || w1 + w2 > res) break;
      if (i * f[0] + j * f[1] + k * f[2] != s) continue;
      int cr = abs(w1) + abs(w2);
      if (cr < res) res = cr, ri = i, rj = j, rk = k;
    }
  }
  if (res == (~0u >> 1))
    puts("-1");
  else
    printf("%d %d %d\n", ri, rj, rk);
}
