#include <bits/stdc++.h>
using namespace std;
const int M = 35, mod = 998244353;
int n, m;
long long base[M];
inline bool insert(long long x) {
  for (int i = m - 1; ~i; --i)
    if ((x >> i) & 1) {
      if (!base[i]) {
        base[i] = x;
        return true;
      }
      x ^= base[i];
    }
  return false;
}
int mul = 1, cnt[1 << 16];
inline int popcnt(long long x) {
  return cnt[x & 65535] + cnt[(x >> 16) & 65535] + cnt[(x >> 32) & 65535] +
         cnt[(x >> 48) & 65535];
}
inline void upd(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
template <typename _T>
inline void read(_T &x) {
  x = 0;
  char c = getchar();
  bool f = 0;
  while (c < '0' || c > '9') f |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
  if (f) x = -x;
}
int tot, ans[M + 1];
long long val[M];
namespace Solve1 {
void dfs(int pos, long long w) {
  if (pos == tot) {
    ans[popcnt(w)]++;
    return;
  }
  dfs(pos + 1, w), dfs(pos + 1, w ^ val[pos]);
}
void solve() { dfs(0, 0); }
}  // namespace Solve1
namespace Solve2 {
int dp[1 << (M / 2)][M + 1];
void solve() {
  tot = 0;
  long long mask = 0;
  for (int i = m - 1; ~i; --i) {
    if (!base[i]) continue;
    val[tot++] = base[i] ^ (1ll << i);
    mask |= val[tot - 1];
  }
  for (int i = 0; i < tot; ++i) {
    long long w = 0, res = 0;
    for (int j = 0; j < m; ++j) {
      if (!((mask >> j) & 1)) continue;
      if ((val[i] >> j) & 1) res |= (1 << w);
      ++w;
    }
    val[i] = res;
  }
  dp[0][0] = 1;
  int bit = popcnt(mask);
  for (int k = 0; k < tot; ++k)
    for (int j = tot; j; --j)
      for (int i = 0; i < (1 << bit); i++) upd(dp[i][j], dp[i ^ val[k]][j - 1]);
  for (int i = 0; i < (1 << bit); i++)
    for (int j = tot; ~j; --j) upd(ans[popcnt(i) + j], dp[i][j]);
}
}  // namespace Solve2
int main() {
  read(n), read(m);
  for (int i = 1; i <= n; ++i) {
    long long x;
    read(x);
    if (!insert(x)) mul = (mul << 1) % mod;
  }
  for (int i = 0; i < (1 << 16); ++i) cnt[i] = cnt[i >> 1] + (i & 1);
  for (int i = m - 1; ~i; --i) {
    if (!base[i]) continue;
    for (int j = i - 1; ~j; --j)
      if ((base[i] >> j) & 1) base[i] ^= base[j];
    val[tot++] = base[i];
  }
  if (tot <= 20)
    Solve1::solve();
  else
    Solve2::solve();
  for (int i = 0; i <= m; ++i) {
    ans[i] = 1LL * ans[i] * mul % mod;
    printf("%d ", ans[i]);
  }
  exit(0);
}
