#include <bits/stdc++.h>
template <class T>
inline void read(T &res) {
  res = 0;
  bool bo = 0;
  char c;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    bo = 1;
  else
    res = c - 48;
  while ((c = getchar()) >= '0' && c <= '9')
    res = (res << 3) + (res << 1) + (c - 48);
  if (bo) res = ~res + 1;
}
const int N = 2e5 + 5, E = 40, C = 17000, djq = 998244353;
int n, m, orz = 1, cnt1, p1[N], cnt0, p0[N], f[E][E][C], st[E], ans[E];
long long a[N], b[E];
void ins(long long x) {
  for (int i = m - 1; i >= 0; i--) {
    if (!((x >> i) & 1)) continue;
    if (b[i] == -1)
      return (void)(b[i] = x);
    else
      x ^= b[i];
  }
  orz = (orz << 1) % djq;
}
int cc(long long x) {
  int res = 0;
  while (x) res += x & 1, x >>= 1;
  return res;
}
int main() {
  read(n);
  read(m);
  for (int i = 0; i < m; i++) b[i] = -1;
  for (int i = 1; i <= n; i++) read(a[i]), ins(a[i]);
  for (int i = 0; i < m; i++)
    if (b[i] != -1)
      for (int j = i + 1; j < m; j++)
        if (b[j] != -1 && ((b[j] >> i) & 1)) b[j] ^= b[i];
  for (int i = 0; i < m; i++)
    if (b[i] != -1)
      p1[++cnt1] = i;
    else
      p0[++cnt0] = i;
  if (cnt1 <= 20) {
    for (int S = 0; S < (1 << cnt1); S++) {
      long long T = 0;
      for (int i = 1; i <= cnt1; i++)
        if ((S >> i - 1) & 1) T ^= b[p1[i]];
      ans[cc(T)]++;
    }
  } else {
    for (int i = 1; i <= cnt1; i++)
      for (int j = 1; j <= cnt0; j++)
        if ((b[p1[i]] >> p0[j]) & 1) st[i] |= 1 << j - 1;
    f[0][0][0] = 1;
    for (int i = 0; i < cnt1; i++)
      for (int j = 0; j <= i; j++)
        for (int S = 0; S < (1 << cnt0); S++) {
          f[i + 1][j][S] = (f[i + 1][j][S] + f[i][j][S]) % djq;
          f[i + 1][j + 1][S ^ st[i + 1]] =
              (f[i + 1][j + 1][S ^ st[i + 1]] + f[i][j][S]) % djq;
        }
    for (int j = 0; j <= cnt1; j++)
      for (int S = 0; S < (1 << cnt0); S++) {
        int x = j + cc(S);
        ans[x] = (ans[x] + f[cnt1][j][S]) % djq;
      }
  }
  for (int i = 0; i <= m; i++) printf("%d ", 1ll * ans[i] * orz % djq);
  puts("");
  return 0;
}
