#include<bits/stdc++.h>
using namespace std;
int W[421];
map<int, long long> backpack[421];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, K;
    cin >> n >> K;
    for(int i = 0; i < n; i++)
    {
        cin>>W[i];
    }
    for(int k=0; k<n; k++)
    {
        backpack[0][0]=1;
        for(int i = 0; i < n; i++)
        {
            if(i == k)
                continue;
            for(int m = K; m > -1; m--)
            {
                for(auto it = backpack[m].begin(); it != backpack[m].end(); it++)
                    if(it->second)
                        if(m + W[i] <= K)
                            backpack[m+W[i]][it->first+1]+=it->second;
            }
        }
        long long wyn = 0;
        for(int j = 1; j <= n-1; j++)
        {
            for(int m = K; m > K - W[k]; m--)
            {
                if(backpack[m][j])
                {
                    wyn += backpack[m][j];
                    wyn %= 167772161;
                }
            }
            cout << wyn <<" ";
            wyn = 0;
        }
        cout<<"\n";
        for(int i = K; i > -1; i--)
                backpack[i].clear();
    }
}