#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, t;
  cin >> n >> t;
  long long int arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  for (i = 0; i < n; i++) {
    vector<long long int> v;
    if (i == 0)
      cout << "0 ";
    else {
      sort(arr, arr + i);
      v.push_back(arr[0] + arr[i]);
      for (j = 1; j < i; j++) v.push_back(v[j - 1] + arr[j]);
      vector<long long int>::iterator it;
      it = lower_bound(v.begin(), v.begin() + i, t);
      if (v[it - v.begin()] == t)
        cout << i - (it - v.begin()) - 1 << " ";
      else
        cout << i - (it - v.begin()) << " ";
    }
  }
}
