#include <bits/stdc++.h>
// #define LOCAL
#define INF 0x3f3f3f3f3f3f3f3f
#define IOS ios::sync_with_stdio(false), cin.tie(0)
// #define int long long
#define debug(a) cerr << #a << "=" << a << endl;
using namespace std;
const int base = 1e4, N = 110, M = 2e4 + 10;
int f[N][M], a[N], ans[N];
int n, t;
signed main(){
#ifdef LOCAL
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
#endif
IOS;
cin >> n >> t;
for (int i = 1; i <= n; ++i)
cin >> a[i];
f[1][a[1] + base] = 1;
f[2][a[1] - a[2] + base] = -1;
for (int i = 3; i <= n; ++i)
for (int j = 0; j <= 10000 + base; ++j)
if(f[i - 1][j]){
f[i][j + a[i]] = 1;
f[i][j - a[i]] = -1;
}
//逆推
int s = t + base;
for (int i = n; i >= 2; --i){
ans[i] = f[i][s];
s -= f[i][s] * a[i];
}
int tot = 0;
for (int i = 2; i <= n; ++i)
if (ans[i] == 1){
cout << i - tot - 1 << '\n';
++tot;
}
for (; tot < n - 1; ++tot)
cout << 1 << '\n';
}