#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 19;
const int mod = 998244353;
const int inv2 = (mod + 1) / 2;
const int DFT = 1;
const int IDFT = -1;
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
inline void inc(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
inline void dec(int &a, int b) {
  a -= b;
  if (a < 0) a += mod;
}
inline int mul(int a, int b) { return 1ll * a * b % mod; }
inline int mul(int a, int b, int c) { return 1ll * a * b % mod * c % mod; }
inline int _pow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = mul(res, a);
    a = mul(a, a);
    n >>= 1;
  }
  return res;
}
void FWT_XOR(int *a, int len, int opt) {
  for (int i = 1; i < len; i <<= 1) {
    int step = i << 1;
    for (int j = 0; j < len; j += step) {
      for (int k = 0; k < i; k++) {
        int x = a[j + k];
        int y = a[i + j + k];
        a[j + k] = add(x, y);
        a[i + j + k] = sub(x, y);
        if (opt == DFT) continue;
        a[j + k] = mul(a[j + k], inv2);
        a[i + j + k] = mul(a[i + j + k], inv2);
      }
    }
  }
}
int f[maxn];
int g[maxn];
int bct[maxn];
int a[105];
vector<int> P[55];
long long b[105];
long long num[105];
bool insert(long long x) {
  for (int i = 36; i >= 0; i--) {
    if (x >> i & 1) {
      if (!b[i]) {
        b[i] = x;
        return true;
      } else
        x ^= b[i];
    }
  }
  return false;
}
int main(void) {
  bct[0] = 0;
  for (int i = 1; i < maxn; i++) bct[i] = bct[i >> 1] + (i & 1);
  int n, m;
  scanf("%d%d", &n, &m);
  int r = 0;
  for (int i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    if (insert(x)) r++;
  }
  int lim = 1 << 18;
  int len = lim;
  int sz = 0;
  for (int i = 0; i < 18; i++) {
    if (!b[i]) continue;
    num[sz++] = b[i];
  }
  for (int s = 0; s < 1 << sz; s++) {
    long long x = 0;
    for (int i = 0; i < sz; i++)
      if (s >> i & 1) x ^= num[i];
    f[x]++;
  }
  FWT_XOR(f, len, DFT);
  sz = 0;
  for (int i = 18; i < m; i++) {
    if (!b[i]) continue;
    num[sz++] = b[i];
  }
  for (int s = 0; s < (1 << sz); s++) {
    long long x = 0;
    for (int i = 0; i < sz; i++)
      if (s >> i & 1) x ^= num[i];
    long long nx = x >> 18;
    int ny = (x ^ (nx << 18));
    assert(ny == ((lim - 1) & x));
    P[bct[nx]].push_back(ny);
  }
  for (int i = 0; i < 18; i++) {
    memset(g, 0, sizeof(g));
    for (int x : P[i]) g[x]++;
    FWT_XOR(g, len, DFT);
    for (int j = 0; j < len; j++) g[j] = mul(g[j], f[j]);
    FWT_XOR(g, len, IDFT);
    for (int j = 0; j < lim; j++) {
      int bj = bct[j];
      a[i + bj] = add(a[i + bj], g[j]);
    }
  }
  int bas = _pow(2, n - r);
  for (int i = 0; i <= m; i++)
    printf("%d%c", mul(a[i], bas), (i == m) ? '\n' : ' ');
  return 0;
}
