#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, lim, BIT, inv;
long long a[200005], g[35], S;
int F[1 << 17], G[19][1 << 17], bit[1 << 17], cal[1 << 17], ans[40];
long long read() {
  long long x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x;
}
void dfs(int pos, int x) {
  if (pos > lim) {
    F[x]++;
    return;
  }
  dfs(pos + 1, x);
  if (g[pos]) dfs(pos + 1, x ^ g[pos]);
}
void dfs1(int pos, long long x) {
  if (pos > m - 1) {
    int Bit = 0;
    for (int i = lim + 1; i <= m - 1; i++)
      if (x & (1ll << i)) Bit++, x ^= 1ll << i;
    G[Bit][x]++;
    return;
  }
  dfs1(pos + 1, x);
  if (g[pos]) dfs1(pos + 1, x ^ g[pos]);
}
void FWT(int *x, int on) {
  for (int i = 2; i <= S; i *= 2) {
    for (int j = 0; j < S; j += i) {
      for (int k = 0; k < i / 2; k++) {
        int u = x[j + k], v = x[j + k + i / 2];
        if (on == 1)
          x[j + k] = (u + v) % 998244353,
                x[j + k + i / 2] = (u - v + 998244353) % 998244353;
        if (on == -1)
          x[j + k] = 1ll * (u + v) * inv % 998244353,
                x[j + k + i / 2] = 1ll * (u - v + 998244353) * inv % 998244353;
      }
    }
  }
}
int main() {
  n = read(), m = read();
  cnt = 1;
  inv = (998244353 + 1) / 2;
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    for (int j = m - 1; j >= 0; j--) {
      if (a[i] & (1ll << j)) {
        if (!g[j]) {
          g[j] = a[i];
          break;
        }
        a[i] ^= g[j];
      }
    }
    if (a[i] == 0) cnt = 2ll * cnt % 998244353;
  }
  lim = m / 2 - 1;
  dfs(0, 0);
  dfs1(lim + 1, 0);
  BIT = m - lim - 1;
  S = 1 << (lim + 1);
  for (int i = 1; i < S; i++) bit[i] = bit[i / 2] + (i & 1);
  FWT(F, 1);
  for (int i = 0; i <= BIT; i++) {
    FWT(G[i], 1);
    for (int j = 0; j < S; j++) cal[j] = 1ll * G[i][j] * F[j] % 998244353;
    FWT(cal, -1);
    for (int j = 0; j < S; j++)
      (ans[i + bit[j]] += 1ll * cal[j] * cnt % 998244353) %= 998244353;
  }
  for (int i = 0; i <= m; i++) printf("%d ", ans[i]);
  return 0;
}
