#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const long long INFLL = 1e18;
const long long MAXN = 1e6 + 100;
const long long INF = 1e9;
const long long mod1 = 998244353;
const long long mod2 = 2e9 + 11;
long long n, m;
long long b[35];
long long two[MAXN];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  long long f = 1;
  for (long long i = 0; i < MAXN; i++) two[i] = f, f *= 2, f %= mod1;
  long long sz = 0;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    for (long long j = 0; j < m; j++) {
      if (((x >> j) & 1ll) == 0) continue;
      if (b[j])
        x ^= b[j];
      else {
        sz++;
        b[j] = x;
        break;
      }
    }
  }
  vector<long long> ans(m + 1);
  if (sz <= 17) {
    vector<long long> basis;
    for (long long i = 0; i < m; i++) {
      if (b[i]) basis.push_back(b[i]);
    }
    for (long long mask = 0; mask < (1 << sz); mask++) {
      long long x = 0;
      for (long long i = 0; i < sz; i++) {
        if ((mask >> i) & 1) x ^= basis[i];
      }
      ans[__builtin_popcountll(x)]++;
    }
  } else {
    for (long long i = 0; i < m; i++) {
      if (b[i]) {
        for (long long j = i + 1; j < m; j++) {
          if (b[j] && (b[i] >> j) & 1) {
            b[i] ^= b[j];
          }
        }
      }
    }
    vector<long long> basis;
    for (long long i = 0; i < m; i++) {
      if (b[i]) {
        long long x = 0;
        long long cur = 0;
        for (long long j = 0; j < m; j++) {
          if (b[j]) continue;
          if ((b[i] >> j) & 1ll) x |= (1ll << cur);
          cur++;
        }
        basis.push_back(x);
      }
    }
    vector<vector<long long> > dp(sz + 1, vector<long long>(1ll << (m - sz)));
    dp[0][0] = 1;
    for (long long i = 0; i < sz; i++) {
      for (long long j = i; j >= 0; j--) {
        for (long long mask = 0; mask < (1ll << (m - sz)); mask++) {
          dp[j + 1][(mask ^ basis[i])] += dp[j][mask];
          dp[j + 1][(mask ^ basis[i])] %= mod1;
        }
      }
    }
    for (long long i = 0; i <= sz; i++) {
      for (long long mask = 0; mask < (1ll << (m - sz)); mask++) {
        ans[i + __builtin_popcount(mask)] += dp[i][mask];
        ans[i + __builtin_popcount(mask)] %= mod1;
      }
    }
  }
  for (long long i = 0; i <= m; i++) ans[i] = (ans[i] * two[n - sz]) % mod1;
  for (auto to : ans) cout << to << " ";
}
