#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long n, m, k;
vector<long long> a, b;
void do_swap(long long& x, int i, int j) {
  if ((x >> i) % 2 != (x >> j) % 2) x ^= (b[i] ^ b[j]);
}
void add(long long& x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  k = n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    int j = i;
    long long x = a[j];
    for (int e = i; e < n; ++e) {
      if (x < a[e]) {
        x = a[e];
        j = e;
      }
    }
    swap(a[i], a[j]);
    if (a[i] == 0) {
      a.resize(k = i);
      break;
    }
    for (int e = i + 1; e < n; ++e)
      if ((a[e] ^ a[i]) < a[e]) a[e] ^= a[i];
  }
  for (int i = 0; i < k; ++i)
    for (int j = 0; j < i; ++j)
      if ((a[j] ^ a[i]) < a[j]) a[j] ^= a[i];
  long long mul = 1;
  for (int i = 0; i < n - k; ++i) mul = (mul * 2) % mod;
  vector<long long> res(m + 1, 0);
  if (k < 23) {
    int lim = 1 << k;
    for (int ma = 0; ma < lim; ++ma) {
      long long x = 0;
      for (int i = 0; i < k; ++i)
        if ((ma >> i) % 2) x ^= a[i];
      add(res[__builtin_popcountll(x)], 1);
    }
    for (int i = 0; i < res.size(); ++i) cout << (res[i] * mul) % mod << " ";
    return 0;
  }
  b.resize(m);
  for (int i = 0; i < m; ++i) b[i] = 1ll << i;
  int j = m - 1;
  for (int i = 0; i < k; ++i) {
    while ((a[i] & b[j]) == 0) --j;
    for (int e = 0; e < k; ++e) do_swap(a[e], j, m - 1 - i);
  }
  int lim = (1 << (m - k)) - 1;
  for (int i = 0; i < k; ++i) a[i] &= lim;
  ++lim;
  vector<vector<vector<long long> > > dp(
      k + 1, vector<vector<long long> >(k + 1, vector<long long>(lim, 0)));
  dp[0][0][0] = 1;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < k; ++j) {
      for (int ma = 0; ma < lim; ++ma) {
        add(dp[i + 1][j][ma], dp[i][j][ma]);
        add(dp[i + 1][j + 1][ma ^ a[i]], dp[i][j][ma]);
      }
    }
  }
  for (int j = 0; j <= k; ++j)
    for (int ma = 0; ma < lim; ++ma)
      add(res[__builtin_popcountll(ma) + j], dp[k][j][ma]);
  for (int i = 0; i < res.size(); ++i) cout << (res[i] * mul) % mod << " ";
  return 0;
}
