#include <bits/stdc++.h>
int N, n, m, a[11], ans = (1 << 30), I, J, K;
int main() {
  scanf("%d%d", &N, &m);
  for (int i = 1, x; i <= N; i++) {
    scanf("%d", &x);
    a[x]++;
    n += (x >= 3);
  }
  for (int i = m / n; i >= 0; i--)
    for (int j = (m - i * a[3]) / (n - a[3]); j >= i; j--) {
      int k = (m - i * a[3] - j * a[4]) / a[5];
      if (i * a[3] + j * a[4] + k * a[5] != m || k < j) continue;
      if (abs(i * a[3] - j * a[4]) + k * a[5] - j * a[4] > ans) break;
      int x = abs(i * a[3] - j * a[4]) + abs(j * a[4] - k * a[5]);
      if (x < ans) ans = x, I = i, J = j, K = k;
    }
  if (ans == (1 << 30))
    printf("-1\n");
  else
    printf("%d %d %d\n", I, J, K);
}
