#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void ckmin(T &a, U b) {
  if (a > b) a = b;
}
template <class T, class U>
void ckmax(T &a, U b) {
  if (a < b) a = b;
}
const int MAXN = 200013;
const int MAXM = 36;
const int INF = 998244353;
const int HALF = (INF + 1) / 2;
int add(int a, int b) {
  a += b;
  if (a >= INF) a -= INF;
  return a;
}
int mul(int a, int b) { return (long long)a * b % INF; }
int N, M, B;
long long arr[MAXN];
int pw2[MAXN];
long long val[MAXM];
long long ans[MAXM];
long long stor[(1 << 18)];
long long dp[MAXM][(1 << 18)];
long long dp1[(1 << 18)], dp2[(1 << 18)];
int c;
vector<long long> nums, lt, rt;
int32_t main() {
  cout << fixed << setprecision(12);
  cerr << fixed << setprecision(4);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  for (auto i = (0); i < (N); i++) {
    cin >> arr[i];
  }
  pw2[0] = 1;
  for (auto i = (1); i < (N + 1); i++) {
    pw2[i] = add(pw2[i - 1], pw2[i - 1]);
  }
  for (auto i = (0); i < (N); i++) {
    long long x = arr[i];
    for (auto j = (M)-1; j >= (0); j--) {
      ckmin(x, val[j] ^ x);
    }
    if (x == 0) continue;
    int b = 63 - __builtin_clzll(x);
    val[b] = x;
  }
  for (auto i = (M)-1; i >= (0); i--) {
    for (auto j = (i + 1); j < (M); j++) {
      ckmin(val[j], val[j] ^ val[i]);
    }
  }
  for (auto i = (M)-1; i >= (0); i--) {
    if (val[i] == 0) continue;
    nums.push_back(val[i]);
  }
  B = ((M + 1) / 2);
  for (long long x : nums) {
    if (x >= (1ll << B))
      lt.push_back(x);
    else
      (rt.push_back(x));
  }
  int n = ((int)(lt).size()), m = ((int)(rt).size());
  stor[0] = 0;
  for (auto i = (1); i < ((1 << n)); i++) {
    int idx = 31 - __builtin_clz(i);
    stor[i] = stor[i - (1 << idx)] ^ lt[idx];
  }
  for (auto i = (0); i < ((1 << n)); i++) {
    long long part = ((stor[i]) & (((1ll << B) - 1)));
    dp[__builtin_popcountll(stor[i] ^ part)][part]++;
  }
  for (auto i = (0); i < (B + 1); i++) {
    for (auto j = (0); j < ((1 << B)); j++) {
      dp1[j] = dp[i][j];
      dp2[j] = 0;
    }
    for (long long x : rt) {
      for (auto j = (0); j < ((1 << B)); j++) {
        dp2[j] = dp1[j];
        dp1[j] = 0;
      }
      for (auto j = (0); j < ((1 << B)); j++) {
        dp1[j ^ x] = add(dp1[j ^ x], dp2[j]);
        dp1[j] = add(dp1[j], dp2[j]);
      }
    }
    for (auto j = (0); j < ((1 << B)); j++) {
      ans[i + __builtin_popcount(j)] =
          add(ans[i + __builtin_popcount(j)], dp1[j]);
    }
  }
  for (auto i = (0); i < (M + 1); i++) {
    ans[i] = mul(ans[i], pw2[N - n - m]);
  }
  for (auto i = (0); i < (M + 1); i++) {
    cout << ans[i] << " \n"[i == M];
  }
  return 0;
}
