#include <bits/stdc++.h>
using namespace std;
int n, x1, a[120], s, ans, ii, jj, kk;
inline int abss(int x) {
  if (x < 0) return -x;
  return x;
}
int main() {
  ans = 2100000000;
  scanf("%d %d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x1);
    a[x1]++;
  }
  for (int i = s / n; i >= 0; i--) {
    for (int j = (s - a[3] * i) / (n - a[3]); j >= 0; j--) {
      if ((s - a[3] * i - a[4] * j) % a[5] != 0) continue;
      int k = (s - a[3] * i - a[4] * j) / a[5];
      if (k * a[5] - j * a[4] > ans) break;
      if (!(i <= j && j <= k)) continue;
      if (k * a[5] + i * a[3] + j * a[4] == s) {
        if (abss(i * a[3] - j * a[4]) + abss(j * a[4] - k * a[5]) < ans) {
          ans = abss(i * a[3] - j * a[4]) + abss(j * a[4] - k * a[5]);
          ii = i;
          jj = j;
          kk = k;
        }
      }
    }
  }
  if (ans == 2100000000) {
    printf("-1\n");
  } else {
    printf("%d %d %d\n", ii, jj, kk);
  }
  return 0;
}
