#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
#pragma GCC optimize("Ofast,no-stack-protector")
using namespace std;
const int maxn = (int)2e5 + 10, mod = 998244353;
int add(int x, int y) {
  x += y;
  if (x >= mod) {
    x -= mod;
  }
  return x;
}
int sub(int x, int y) {
  x -= y;
  if (x < 0) {
    x += mod;
  }
  return x;
}
int mul(int x, int y) { return (long long)x * y % mod; }
long long v[maxn];
vector<long long> g;
int cntg(long long x) {
  int ans = 0;
  while (x) {
    ans += x & 1;
    x >>= 1;
  }
  return ans;
}
int res[100];
int my_pow(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) {
      ans = mul(ans, x);
    }
    y >>= 1;
    x = mul(x, x);
  }
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &v[i]);
  }
  sort(v, v + n);
  reverse(v, v + n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    long long y = v[i];
    for (long long x : g) {
      if ((y ^ x) < y) {
        y ^= x;
      }
    }
    if (y == 0) {
      cnt++;
    } else {
      g.push_back(y);
    }
  }
  int mag = 18;
  map<pair<long long, int>, int> num[2];
  num[0][make_pair(0, 0)] = 1;
  int it = 1;
  for (long long x : g) {
    num[it].clear();
    int o = 35;
    while (((x >> o) & 1) == 0) {
      o--;
    }
    for (auto itr : num[it ^ 1]) {
      long long y = itr.first.first ^ x;
      int cn = itr.first.second;
      int tot = itr.second;
      if ((y >> o) & 1) {
        y ^= (1ll << o);
        cn++;
      }
      auto &w = num[it][make_pair(y, cn)];
      w = add(w, tot);
      y = itr.first.first;
      cn = itr.first.second;
      tot = itr.second;
      if ((y >> o) & 1) {
        y ^= (1ll << o);
        cn++;
      }
      auto &w1 = num[it][make_pair(y, cn)];
      w1 = add(w1, tot);
    }
    it ^= 1;
  }
  it ^= 1;
  int st = my_pow(2, cnt);
  for (auto itr : num[it]) {
    long long x = itr.first.first;
    int cn = cntg(x) + itr.first.second;
    int tot = itr.second;
    res[cn] = add(res[cn], mul(tot, st));
  }
  for (int i = 0; i <= m; i++) {
    cout << res[i] << ' ';
  }
}
