#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 998244353;
struct Comb {
  int n;
  vector<int> fact, inv;
  Comb(){};
  Comb(int _n) : n(_n), fact(_n + 5, 0), inv(_n + 5, 0) {
    fact[0] = fact[1] = inv[0] = inv[1] = 1;
    for (int i = (int)2; i <= (int)n; i++) {
      fact[i] = 1LL * fact[i - 1] * i % mod;
      inv[i] = (mod - 1LL * (mod / i) * inv[mod % i] % mod) % mod;
    }
    for (int i = (int)2; i <= (int)n; i++)
      inv[i] = 1LL * inv[i] * inv[i - 1] % mod;
  };
  int operator()(int x, int y) {
    if (x > y) return 0;
    return 1LL * fact[y] * inv[x] % mod * inv[y - x] % mod;
  }
} C(100);
int n, m;
ll basis[35];
int zer, one;
void add(ll x) {
  for (int i = (int)34; i >= (int)0; i--) {
    if (!((x >> i) & 1)) continue;
    if (basis[i] == -1) {
      basis[i] = x;
      return;
    }
    x ^= basis[i];
  }
  zer++;
}
void gauss() {
  for (int i = (int)0; i <= (int)34; i++) {
    if (basis[i] == -1) continue;
    for (int j = (int)i + 1; j <= (int)34; j++) {
      if (basis[j] != -1 && ((basis[j] >> i) & 1)) basis[j] ^= basis[i];
    }
  }
}
void solveSmall(vector<int>& ans) {
  vector<ll> a;
  for (int i = (int)0; i <= (int)34; i++)
    if (basis[i] != -1) a.push_back(basis[i]);
  for (int mask = (int)0; mask <= (int)(1 << a.size()) - 1; mask++) {
    int mask2 = mask;
    ll cur = 0;
    while (mask2) {
      int i = __builtin_ctzll(mask2);
      mask2 ^= (1 << i);
      cur ^= a[i];
    }
    ans[__builtin_popcountll(cur)]++;
  }
}
void solveBig(vector<int>& ans) {
  vector<ll> a;
  for (int i = (int)0; i <= (int)34; i++)
    if (basis[i] != -1) a.push_back(basis[i] ^ (1LL << i));
  vector<int> alpos;
  for (auto it : a) {
    while (it) {
      int i = __builtin_ctzll(it);
      it ^= (1LL << i);
      alpos.push_back(i);
    }
  }
  sort(alpos.begin(), alpos.end());
  alpos.resize(distance(alpos.begin(), unique(alpos.begin(), alpos.end())));
  if (alpos.empty()) {
    for (int i = (int)0; i <= (int)ans.size() - 1; i++) ans[i] = C(i, a.size());
    return;
  }
  vector<ll> b;
  for (auto it : a) {
    ll cur = 0;
    for (int i = (int)0; i <= (int)alpos.size() - 1; i++)
      cur ^= ((((it >> alpos[i]) & 1) * 1LL) << i);
    b.push_back(cur);
  }
  a.swap(b);
  n = a.size();
  m = alpos.size();
  vector<vector<vector<int> > > dp(
      2, vector<vector<int> >(n + 1, vector<int>(1 << m, 0)));
  dp[0][0][0] = 1;
  for (int lev = (int)0; lev <= (int)n - 1; lev++) {
    int c = lev & 1;
    for (int chose = (int)0; chose <= (int)lev + 1; chose++)
      for (int mask = (int)0; mask <= (int)(1 << m) - 1; mask++)
        dp[c ^ 1][chose][mask] = 0;
    for (int chose = (int)0; chose <= (int)lev; chose++) {
      for (int mask = (int)0; mask <= (int)(1 << m) - 1; mask++) {
        if (dp[c][chose][mask] == 0) continue;
        dp[c ^ 1][chose + 1][mask ^ a[lev]] =
            (dp[c ^ 1][chose + 1][mask ^ a[lev]] + dp[c][chose][mask]) % mod;
        dp[c ^ 1][chose][mask] =
            (dp[c ^ 1][chose][mask] + dp[c][chose][mask]) % mod;
      }
    }
  }
  for (int chose = (int)0; chose <= (int)n; chose++)
    for (int mask = (int)0; mask <= (int)(1 << m) - 1; mask++) {
      if (dp[n & 1][chose][mask] != 0)
        ans[chose + __builtin_popcountll(mask)] =
            (ans[chose + __builtin_popcountll(mask)] + dp[n & 1][chose][mask]) %
            mod;
    }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  memset(basis, -1, sizeof(basis));
  for (int i = (int)0; i <= (int)n - 1; i++) {
    ll t;
    cin >> t;
    add(t);
  }
  gauss();
  int cnt87 = 0;
  for (int i = (int)0; i <= (int)34; i++) cnt87 += (basis[i] != -1);
  vector<int> ans(m + 1, 0);
  if (cnt87 <= 18)
    solveSmall(ans);
  else
    solveBig(ans);
  int two = 1;
  for (int i = (int)1; i <= (int)zer; i++) two = two * 2 % mod;
  for (auto& it : ans) it = 1LL * it * two % mod;
  for (auto it : ans) cout << it << ' ';
  cout << '\n';
}
