#include <bits/stdc++.h>
using namespace std;
template <class T, class T1>
int chkmin(T &x, const T1 &y) {
  return x > y ? x = y, 1 : 0;
}
template <class T, class T1>
int chkmax(T &x, const T1 &y) {
  return x < y ? x = y, 1 : 0;
}
const int MAXN = (1 << 20);
const int B = 64;
const int mod = 998244353;
int n, m;
int64_t a[MAXN];
void read() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
}
int64_t basis[B];
bool add(int64_t x) {
  for (int64_t i = m - 1; i >= 0; i--) {
    if (((x >> i) & 1ll)) {
      if (basis[i])
        x ^= basis[i];
      else {
        basis[i] = x;
        return true;
      }
    }
  }
  return false;
}
int F[40][(1 << 18)];
int S[(1 << 18)];
int res[40][(1 << 18)];
void rec(int64_t i, int h, int64_t v, int cnt = 0) {
  if (i == h) {
    v = v & ((1ll << (h + 1ll)) - 1ll);
    F[cnt][v]++;
    return;
  }
  rec(i - 1, h, v, cnt + ((v >> i) & 1));
  if (basis[i]) {
    rec(i - 1, h, v ^ basis[i], cnt + (((v ^ basis[i]) >> i) & 1));
  }
}
int64_t answer[MAXN];
int popcnt[MAXN];
void rec2(int64_t i, int64_t v) {
  if (i == -1) {
    S[v]++;
    return;
  }
  if (!basis[i])
    rec2(i - 1, v);
  else {
    rec2(i - 1, v ^ basis[i]);
    rec2(i - 1, v);
  }
}
int inv2 = (mod + 1) / 2;
void FWHT(int *P, int l, int sz, bool inverse) {
  for (int len = 1; 2 * len <= sz; len <<= 1) {
    for (int i = 0; i < sz; i += 2 * len) {
      for (int j = 0; j < len; j++) {
        int u = P[i + j];
        int v = P[i + len + j];
        P[i + j] = (u + v) % mod;
        P[i + len + j] = (mod + u - v) % mod;
      }
    }
  }
  if (inverse) {
    int q = 1;
    for (int i = 0; i < l; i++) {
      q = (q * 1ll * inv2) % mod;
    }
    for (int i = 0; i < sz; i++) P[i] = P[i] * 1ll * q % mod;
  }
}
void solve() {
  if (m == 0) {
    int ans = 1;
    for (int i = 0; i < n; i++) {
      ans = ans * 2ll % mod;
    }
    cout << ans << '\n';
    return;
  }
  popcnt[0] = 0;
  for (int i = 1; i < (1 << 20); i++) {
    popcnt[i] = popcnt[i >> 1] + (i & 1);
  }
  int64_t mult = 1;
  for (int i = 0; i < n; i++) {
    if (!add(a[i])) mult = (mult * 2ll) % mod;
  }
  int h = max(0, m - 20);
  rec(m - 1, h, 0);
  rec2(h, 0);
  h++;
  int sz = (1 << (h));
  for (int i = 0; i <= m; i++) {
    FWHT(F[i], h, sz, 0);
  }
  FWHT(S, h, sz, 0);
  for (int i = 0; i <= m; i++) {
    for (int p = 0; p < sz; p++) {
      res[i][p] = (res[i][p] + F[i][p] * 1ll * S[p]) % mod;
    }
  }
  for (int i = 0; i <= m; i++) {
    FWHT(res[i], h, sz, 1);
    for (int j = 0; j < sz; j++) {
      answer[i + popcnt[j]] = (answer[i + popcnt[j]] + res[i][j]) % mod;
    }
  }
  for (int i = 0; i <= m; i++) {
    cout << (answer[i] * 1ll * mult) % mod << " ";
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
