#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long maxn = 4e5 + 54;
long long n, m;
long long a[maxn];
long long f[28][maxn], g[maxn];
long long d[2333], c = 0;
long long cnt[maxn << 1];
long long ans[maxn], tmp[maxn];
void ins(long long x) {
  for (long long i = m - 1; ~i; i--) {
    if (x & (1ll << i)) {
      if (!d[i]) {
        d[i] = x;
        ++c;
      }
      x ^= d[i];
    }
  }
}
long long mid;
void dfs(long long u, long long num) {
  if (u == mid - 1) {
    f[cnt[num >> mid]][num & ((1 << mid) - 1)]++;
    return;
  }
  dfs(u - 1, num);
  if (d[u]) {
    dfs(u - 1, num ^ d[u]);
  }
}
void dfs2(long long u, long long num) {
  if (u == mid) {
    g[num]++;
    return;
  }
  dfs2(u + 1, num);
  if (d[u]) {
    dfs2(u + 1, num ^ d[u]);
  }
}
long long qpow(long long x, long long y) {
  long long ans = 1;
  for (; y; y >>= 1, x = x * x % mod)
    if (y & 1) ans = ans * x % mod;
  return ans;
}
const long long inv2 = qpow(2, mod - 2);
void fwt(long long *f, long long type, long long n) {
  for (long long len = 1; len < n; len <<= 1) {
    for (long long i = 0; i < n; i += len << 1) {
      for (long long j = 0; j < len; j++) {
        long long x = f[i + j];
        long long y = f[i + j + len];
        f[i + j] = (x + y) % mod;
        f[i + j + len] = (x - y + mod) % mod;
        if (type == -1)
          f[i + j] = f[i + j] * inv2 % mod,
                f[i + j + len] = f[i + j + len] * inv2 % mod;
      }
    }
  }
}
signed main() {
  ios ::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) ins(a[i]);
  mid = m + 1 >> 1;
  for (long long i = 1; i <= 300000; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  dfs(m - 1, 0);
  dfs2(0, 0);
  memcpy(tmp, g, sizeof(g));
  for (long long i = 0; i <= m - mid; i++) {
    memcpy(g, tmp, sizeof(g));
    fwt(f[i], 1, 1 << mid);
    fwt(g, 1, 1 << mid);
    for (long long j = 0; j < (1 << mid); ++j) f[i][j] = f[i][j] * g[j] % mod;
    fwt(f[i], -1, 1 << mid);
    for (long long j = 0; j < (1 << mid); ++j)
      ans[i + cnt[j]] = (ans[i + cnt[j]] + f[i][j]) % mod;
  }
  long long qwq = qpow(2, n - c);
  for (long long i = 0; i <= m; i++) ans[i] = ans[i] * qwq % mod;
  for (long long i = 0; i <= m; i++) cout << ans[i] << ' ';
  cout << '\n';
  return 0;
}
