#include <bits/stdc++.h>
using namespace std;
long long a[200010];
long long f[200010];
long long mod = 998244353;
long long pwr(long long a, int b) {
  if (b == 0) return 1;
  long long x = pwr(a, b / 2);
  x = (x * x) % mod;
  if (b & 1) x = (a * x) % mod;
  return x;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> base;
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<long long> b;
  long long at = 0;
  for (int i = 1; i <= n; i++) {
    long long x = a[i];
    for (int j = 0; j < m; j++) {
      if ((x >> j) & 1) {
        if (!f[j]) {
          f[j] = x;
          break;
        }
        x ^= f[j];
      }
    }
  }
  for (int j = 0; j < m; j++) {
    if (f[j]) b.push_back(f[j]);
  }
  int k = b.size();
  if (k > 22) {
    vector<long long> u(k);
    vector<long long> gd(k, 0);
    long long ret = (1ll << (m)) - 1;
    for (int i = 0; i < k; i++) {
      u[i] = b[i] & (-b[i]);
      ret ^= u[i];
      for (int j = 0; j < k; j++) {
        if (j != i && b[j] & u[i]) {
          b[j] ^= b[i];
        }
      }
    }
    for (int i = 0; i < k; i++) {
      long long hp = ret;
      int ct = 0;
      while (hp != 0) {
        long long uj = hp & (-hp);
        if (b[i] & uj) gd[i] += (1ll << ct);
        hp -= uj;
        ct++;
      }
    }
    vector<vector<vector<long long> > > dp;
    dp.resize(k + 1, vector<vector<long long> >(
                         k + 1, vector<long long>(1 << (m - k), 0)));
    dp[0][0][0] = 1;
    vector<int> pop_cnt((1 << (m - k)), 0);
    for (int i = 0; i < (1 << (m - k)); i++) {
      int uj = i & (-i);
      if (uj != 0) pop_cnt[i] = 1 + pop_cnt[i - uj];
    }
    for (int i = 0; i < k; i++) {
      for (int j = 0; j <= i + 1; j++) {
        for (int msk = 0; msk < (1 << (m - k)); msk++) {
          dp[i + 1][j][msk] = dp[i][j][msk];
          if (j > 0)
            dp[i + 1][j][msk] =
                (dp[i][j][msk] + dp[i][j - 1][msk ^ gd[i]]) % mod;
        }
      }
    }
    vector<long long> p(m + 1, 0);
    for (int j = 0; j <= k; j++) {
      for (int msk = 0; msk < (1 << (m - k)); msk++) {
        p[j + pop_cnt[msk]] += dp[k][j][msk];
      }
    }
    long long svp = pwr(2, n - k);
    for (auto &v : p) {
      v = (v * svp) % mod;
      cout << v << ' ';
    }
    cout << endl;
  } else {
    vector<long long> p(m + 1, 0);
    vector<int> pop_cnt((1 << 20), 0);
    for (int i = 0; i < (1 << 20); i++) {
      int uj = i & (-i);
      if (uj != 0) pop_cnt[i] = 1 + pop_cnt[i - uj];
    }
    long long u = (1 << 20);
    for (int i = 0; i < (1 << k); i++) {
      long long val = 0;
      for (int j = 0; j < k; j++) {
        if (i & (1 << j)) val ^= b[j];
      }
      p[pop_cnt[val & (u - 1)] + pop_cnt[val >> 20]]++;
    }
    u = pwr(2, n - k);
    for (auto &v : p) {
      v = (v * u) % mod;
      cout << v << ' ';
    }
    cout << endl;
  }
}
