#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f, Inf = 0x7fffffff;
const long long INF = 0x7fffffffffffffff;
const double eps = 1e-10;
template <typename _Tp>
_Tp gcd(const _Tp &a, const _Tp &b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp abs(const _Tp &a) {
  return a >= 0 ? a : -a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp max(const _Tp &a, const _Tp &b) {
  return a < b ? b : a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp min(const _Tp &a, const _Tp &b) {
  return a < b ? a : b;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmax(_Tp &a, const _Tp &b) {
  (a < b) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmin(_Tp &a, const _Tp &b) {
  (b < a) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) bool _cmp(const _Tp &a,
                                                    const _Tp &b) {
  return abs(a - b) <= eps;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void read(_Tp &x) {
  register char ch(getchar());
  bool f(false);
  while (ch < 48 || ch > 57) f |= ch == 45, ch = getchar();
  x = ch & 15, ch = getchar();
  while (ch >= 48 && ch <= 57)
    x = (((x << 2) + x) << 1) + (ch & 15), ch = getchar();
  if (f) x = -x;
}
template <typename _Tp, typename... Args>
__inline__ __attribute__((always_inline)) void read(_Tp &t, Args &...args) {
  read(t);
  read(args...);
}
__inline__ __attribute__((always_inline)) int read_str(char *s) {
  register char ch(getchar());
  while (ch == ' ' || ch == '\r' || ch == '\n') ch = getchar();
  register char *tar = s;
  *tar = ch, ch = getchar();
  while (ch != ' ' && ch != '\r' && ch != '\n' && ch != EOF)
    *(++tar) = ch, ch = getchar();
  return tar - s + 1;
}
const int N = 500005;
const int mod = 998244353;
const long long inv2 = (mod + 1) >> 1;
template <typename _Tp1, typename _Tp2>
__inline__ __attribute__((always_inline)) void add(_Tp1 &a, _Tp2 b) {
  (a += b) >= mod && (a -= mod);
}
template <typename _Tp1, typename _Tp2>
__inline__ __attribute__((always_inline)) void sub(_Tp1 &a, _Tp2 b) {
  (a -= b) < 0 && (a += mod);
}
long long d[37];
void insert(long long x) {
  for (int i = 35; i >= 0; --i) {
    if ((x >> i) & 1) {
      if (d[i])
        x ^= d[i];
      else {
        d[i] = x;
        break;
      }
    }
  }
}
void FWT_xor(int *a, int limit) {
  for (int len = 2; len <= limit; len <<= 1) {
    for (int pos = 0; pos < limit; pos += len) {
      for (int i = pos; i < pos + (len >> 1); ++i) {
        int tmp = a[i];
        add(a[i], a[i + (len >> 1)]);
        a[i + (len >> 1)] = (tmp - a[i + (len >> 1)] + mod) % mod;
      }
    }
  }
}
void IFWT_xor(int *a, int limit) {
  for (int len = 2; len <= limit; len <<= 1) {
    for (int pos = 0; pos < limit; pos += len) {
      for (int i = pos; i < pos + (len >> 1); ++i) {
        int tmp = a[i];
        a[i] = inv2 * (a[i] + a[i + (len >> 1)]) % mod;
        a[i + (len >> 1)] = inv2 * (tmp - a[i + (len >> 1)] + mod) % mod;
      }
    }
  }
}
int a[N], b[19][N], c[N];
int ans[37];
int main() {
  int n, m;
  read(n, m);
  long long x;
  for (int i = 1; i <= n; ++i) {
    read(x);
    insert(x);
  }
  int cnt = 0;
  std::vector<long long> v1, v2;
  int hf = (m + 1) >> 1;
  for (int i = 0; i < m; ++i) {
    if (d[i]) {
      ++cnt;
      if (i < hf)
        v1.push_back(d[i]);
      else
        v2.push_back(d[i]);
    }
  }
  for (int i = 0; i < 1 << ((int)v1.size()); ++i) {
    long long s = 0;
    for (int j = 0; j < ((int)v1.size()); ++j) {
      if ((i >> j) & 1) {
        s ^= v1[j];
      }
    }
    ++a[s];
  }
  for (int i = 0; i < 1 << ((int)v2.size()); ++i) {
    long long s = 0;
    for (int j = 0; j < ((int)v2.size()); ++j) {
      if ((i >> j) & 1) {
        s ^= v2[j];
      }
    }
    ++b[__builtin_popcount(s >> hf)][s & ((1 << hf) - 1)];
  }
  int limit = 1 << hf;
  FWT_xor(a, limit);
  for (int i = 0; i <= m - hf; ++i) {
    FWT_xor(b[i], limit);
    for (int j = 0; j < limit; ++j) {
      c[j] = 1ll * a[j] * b[i][j] % mod;
    }
    IFWT_xor(c, limit);
    for (int j = 0; j < limit; ++j) {
      if (c[j]) {
        add(ans[__builtin_popcount(j) + i], c[j]);
      }
    }
  }
  long long qwq = 1;
  cnt = n - cnt;
  while (cnt--) add(qwq, qwq);
  for (int i = 0; i <= m; ++i) printf("%lld ", qwq * ans[i] % mod);
  printf("\n");
  return 0;
}
