#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
signed main() {
  cin.tie(0)->sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> pw(n + 1);
  pw[0] = 1;
  for (long long i = 1; i <= n; i++) pw[i] = 2 * pw[i - 1] % MOD;
  long long _ = n;
  vector<long long> basis;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    for (auto x : basis) a = min(a, a ^ x);
    if (a) {
      long long id = 0;
      while (id < (long long)basis.size() && basis[id] > a) ++id;
      basis.insert(basis.begin() + id, a);
    }
  }
  n = basis.size();
  vector<long long> ans(2 * m + 1, 0);
  if (n <= 20) {
    for (long long mask = 0; mask < (1ll << n); mask++) {
      long long val = 0;
      for (long long i = 0; i < n; i++)
        if (mask & (1ll << i)) val ^= basis[i];
      ans[__builtin_popcountll(val)]++;
    }
  } else {
    vector<bool> good(m);
    for (auto x : basis)
      for (long long i = m - 1; i >= 0; i--)
        if (x & (1ll << i)) {
          good[i] = 1;
          break;
        }
    for (long long i = 0; i < n; i++)
      for (long long j = i + 1; j < n; j++)
        basis[i] = min(basis[i], basis[i] ^ basis[j]);
    vector<long long> stuff(n, 0);
    for (long long i = 0; i < n; i++) {
      long long cnt = 0;
      for (long long j = 0; j < m; j++)
        if (!good[j]) {
          if (basis[i] & (1ll << j)) stuff[i] += (1ll << cnt);
          cnt++;
        }
    }
    vector<vector<vector<long long>>> dp(
        n, vector<vector<long long>>(n + 1,
                                     vector<long long>((1ll << (m - n)), 0)));
    dp[0][1][stuff[0]] = dp[0][0][0] = 1;
    for (long long i = 1; i < n; i++)
      for (long long j = 0; j <= n; j++)
        for (long long k = 0; k < (1ll << (m - n)); k++) {
          dp[i][j][k] = dp[i - 1][j][k];
          if (j) dp[i][j][k] += dp[i - 1][j - 1][k ^ stuff[i]];
        }
    for (long long i = 0; i <= n; i++)
      for (long long j = 0; j < (1ll << (m - n)); j++)
        ans[i + __builtin_popcount(j)] += dp[n - 1][i][j];
  }
  for (long long i = 0; i <= m; i++)
    cout << (ans[i] % MOD) * pw[_ - n] % MOD << " ";
  cout << '\n';
}
