#include <bits/stdc++.h>
using namespace std;
const long long M = 998244353;
long long n, m, x, a[40], dp[2][40][1 << 16], ans[40], num[1 << 20], cnt, p[40],
    v[40];
void dfs(long long x, long long y) {
  if (x == m) {
    long long s = 0;
    while (y) s += y & 1, y >>= 1;
    ans[s]++;
    return;
  }
  dfs(x + 1, y);
  if (a[x]) dfs(x + 1, y ^ a[x]);
}
void insert(long long x) {
  for (long long i = m - 1; i >= 0; i--)
    if ((1ll << i) & x) {
      if (a[i])
        x ^= a[i];
      else {
        a[i] = x;
        return;
      }
    }
}
signed main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &x);
    insert(x);
  }
  for (long long i = 0; i < m; i++)
    if (a[i]) {
      cnt++;
      for (long long j = i + 1; j < m; j++)
        if (a[j] & (1ll << i)) a[j] ^= a[i];
    }
  for (long long i = 0; i < 1 << 20; i++) {
    long long j = i;
    while (j) num[i] += j & 1, j >>= 1;
  }
  if (cnt <= 20)
    dfs(0, 0);
  else {
    long long tot = 0;
    for (long long i = 0; i < m; i++)
      if (!a[i]) p[i] = 1 << tot, tot++;
    for (long long i = 0; i < m; i++)
      for (long long j = 0; j < i; j++)
        if ((1ll << j) & a[i]) assert(p[j]), v[i] += p[j];
    dp[0][0][0] = 1;
    for (long long i = 0; i < m; i++) {
      long long t = i & 1;
      t ^= 1;
      memset(dp[t], 0, sizeof dp[t]);
      for (long long j = 0; j <= i; j++)
        for (long long k = 0; k < 1 << tot; k++)
          if (dp[t ^ 1][j][k]) {
            (dp[t][j][k] += dp[t ^ 1][j][k]) %= M;
            if (a[i]) (dp[t][j + 1][k ^ v[i]] += dp[t ^ 1][j][k]) %= M;
          }
    }
    for (long long i = 0; i <= m; i++)
      for (long long j = 0; j < 1 << tot; j++)
        if (dp[m & 1][i][j]) (ans[i + num[j]] += dp[m & 1][i][j]) %= M;
  }
  long long v = 1;
  for (long long i = 1; i <= n - cnt; i++) (v *= 2) %= M;
  for (long long i = 0; i <= m; i++) printf("%lld ", ans[i] * v % M);
}
