#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) ((x).begin()), ((x).end())

#define READ(x) (cin >> (x))
#define WRITE_N(x) (cout << (x) << endl)
#define WRITE(x) (cout << (x))
#define WRITE_YESNO(x) (WRITE_N((x) ? "Yes" : "No"))

#define PRECISE_COUT std::cout << std::setprecision(15) << std::fixed

bool xor_logic(bool x, bool y) { return (x && y) || (!x && !y); }

struct State {
  int last = 0;
  ll sum_time = 0;
  set<int> unseen;
};

int solve(int N, ll K, std::vector<std::vector<ll>>&T) {
  int retv = 0;

  stack<State> dfs;
  State init_state;
  for (size_t i = 1; i < N; i++) {
    init_state.unseen.insert(i);
  }

  dfs.push(init_state);

  while (!dfs.empty()) {
    State search = dfs.top();
    dfs.pop();
    if (search.unseen.empty()) {
      int sum_time = search.sum_time + T[search.last][0];
      if (sum_time == K) {
        retv++;
      }
    } else {
      for (auto &&i : search.unseen) {
        State new_state;
        new_state.last = i;
        new_state.sum_time = search.sum_time + T[search.last][new_state.last];
        new_state.unseen = search.unseen;
        new_state.unseen.erase(i);

        dfs.push(new_state);
      }
    }
  }

  return retv;
}

int main() {
  // get values from input
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  ll K;
  cin >> N >> K;

  std::vector<std::vector<ll>> T(N, std::vector<ll>(N, 0));
  for (size_t i = 0; i < N; i++) {
    for (size_t j = 0; j < N; j++) {
      cin >> T[i][j];
    }
  }

  // main procedure
  int ans = solve(N, K, T);

  // output
  cout << ans << endl;

  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define fir first
#define sec second
#define mod 998244353
#define ll long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
inline int read()
{
	char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();}
	int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();}
	if(nega==-1) return -ans;
	return ans;
}
typedef pair<int,int> pii;
void print(vector<int> x){for(int i=0;i<(int)x.size();i++) printf("%d%c",x[i]," \n"[i==(int)x.size()-1]);}
inline int add(int x,int y) {return x+y>=mod?x+y-mod:x+y;}
inline int add(int x,int y,int z) {return add(add(x,y),z);}
inline int sub(int x,int y) {return x-y<0?x-y+mod:x-y;}
inline int mul(int x,int y) {return 1LL*x*y%mod;}
inline int mul(int x,int y,int z) {return mul(mul(x,y),z);}
#define N 200005
int a[N],pw[N],val[305],n,k;
int fac[N],inv[N],ifac[N];
const int i2=(mod+1)/2;
void init()
{
	fac[0]=1; for(int i=1;i<N;i++) fac[i]=mul(fac[i-1],i);
	inv[0]=inv[1]=1; for(int i=2;i<N;i++) inv[i]=mul(mod-mod/i,inv[mod%i]);
	ifac[0]=1; for(int i=1;i<N;i++) ifac[i]=mul(ifac[i-1],inv[i]);
}
int C(int x,int y){return x>=y?mul(fac[x],ifac[x-y],ifac[y]):0;}
signed main()
{
	// cout<<sizeof(pw)/1024.0/1024.0<<endl;
	cin>>n>>k; init();
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1;i<=n;i++) pw[i]=1;
	val[0]=n;
	for(int j=1;j<=k;j++)
	{
		for(int i=1;i<=n;i++) pw[i]=mul(pw[i],a[i]);
		for(int i=1;i<=n;i++) val[j]=add(val[j],pw[i]);
	}
	for(int i=1;i<=n;i++) pw[i]=1;
	for(int i=1;i<=k;i++)
	{
		int ans=0;
		for(int j=0;j<=i;j++)
		{
			int tmp=mul(val[j],val[i-j]);
			ans=add(ans,mul(tmp,C(i,j)));
		}
		for(int j=1;j<=n;j++) pw[j]=mul(pw[j],a[j]+a[j]);
		for(int j=1;j<=n;j++) ans=sub(ans,pw[j]);
		ans=mul(ans,i2);
		printf("%d\n",ans);
	}
	return 0;
}


