#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 998244353;
void add(int64_t& a, int64_t b) { a = (a + b) % MOD; }
void mul(int64_t& a, int64_t b) { a = a * b % MOD; }
int64_t power_mod(int64_t num, int64_t power) {
  int64_t prod = 1;
  num %= MOD;
  while (power > 0) {
    if (power & 1) prod = prod * num % MOD;
    num = num * num % MOD;
    power >>= 1;
  }
  return prod;
}
int64_t extgcd(int64_t a, int64_t b, int64_t& x, int64_t& y) {
  int64_t d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1;
    y = 0;
  }
  return d;
}
int64_t inv_mod(int64_t a) {
  int64_t x, y;
  extgcd(a, MOD, x, y);
  return (MOD + x % MOD) % MOD;
}
int nth_bit(int64_t num, int n) { return (num >> n) & 1; }
int64_t msb(int64_t v) {
  v = v | (v >> 1);
  v = v | (v >> 2);
  v = v | (v >> 4);
  v = v | (v >> 8);
  v = v | (v >> 16);
  v = v | (v >> 32);
  return v ^ (v >> 1);
}
struct GJ_Xor {
  vector<int64_t> V;
  int64_t pw = 1;
  void add(int64_t a) {
    for (int64_t v : V)
      if (msb(v) & a) a ^= v;
    if (a > 0) {
      for (int64_t& v : V)
        if (msb(a) & v) v ^= a;
      V.push_back(a);
      sort(V.rbegin(), V.rend());
    } else {
      mul(pw, 2);
    }
  }
};
const int64_t inv2 = inv_mod(2);
vector<int64_t> FWT(vector<int64_t> A, vector<int64_t> B,
                    function<void(vector<int64_t>&, int)> fwt,
                    function<void(vector<int64_t>&, int)> ifwt) {
  int sz = max(A.size(), B.size());
  int N = 1;
  while ((1 << N) < sz) N++;
  A.resize(1 << N);
  B.resize(1 << N);
  fwt(A, N);
  fwt(B, N);
  vector<int64_t> res(1 << N);
  for (int i = 0; i < (1 << N); i++) res[i] = A[i] * B[i];
  ifwt(res, N);
  return res;
}
vector<int64_t> XOR_convolution(vector<int64_t>& A, vector<int64_t>& B) {
  auto fwt = [](vector<int64_t>& X, int N) {
    for (int i = 0; i < N; i++)
      for (int b = 0; b < (1 << N); b++)
        if (nth_bit(b, i)) {
          int64_t x = X[b - (1 << i)], y = X[b];
          X[b - (1 << i)] = x + y, X[b] = x - y;
        }
  };
  auto ifwt = [](vector<int64_t>& X, int N) {
    for (int i = 0; i < N; i++)
      for (int b = 0; b < (1 << N); b++)
        if (nth_bit(b, i)) {
          int64_t x = X[b - (1 << i)], y = X[b];
          X[b - (1 << i)] = (x + y) / 2, X[b] = (x - y) / 2;
        }
  };
  return FWT(A, B, fwt, ifwt);
}
int pop_count(int bits) {
  bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
  bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
  bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
  bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
  return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff);
}
int main() {
  int N, M;
  cin >> N >> M;
  GJ_Xor gj;
  for (int i = 0; i < N; i++) {
    int64_t a;
    scanf("%lld", &a);
    gj.add(a);
  }
  vector<int64_t> V[2];
  for (auto a : gj.V) V[msb(a) < (1 << 18)].push_back(a);
  vector<int64_t> num0[19];
  for (int k = 0; k <= 18; k++) num0[k].resize(1 << 18);
  int sz0 = V[0].size();
  for (int b = 0; b < (1 << sz0); b++) {
    int64_t v = 0;
    for (int i = 0; i < sz0; i++)
      if (nth_bit(b, i)) v ^= V[0][i];
    int up = 0;
    for (int k = 18; k <= M; k++)
      if (nth_bit(v, k)) {
        up++;
        v -= 1LL << k;
      }
    num0[up][v]++;
  }
  vector<int64_t> num1(1 << 18);
  int sz1 = V[1].size();
  for (int b = 0; b < (1 << sz1); b++) {
    int64_t v = 0;
    for (int i = 0; i < sz1; i++)
      if (nth_bit(b, i)) v ^= V[1][i];
    num1[v]++;
  }
  vector<int64_t> ans(M + 1);
  for (int up = 0; up <= 18; up++) {
    auto& X = num0[up];
    auto& Y = num1;
    auto conv = XOR_convolution(X, Y);
    for (int b = 0; b < (1 << 18); b++)
      if (conv[b]) {
        add(ans[up + pop_count(b)], conv[b]);
      }
  }
  int64_t C = gj.pw;
  for (auto& a : ans) {
    mul(a, C);
    printf("%lld ", a);
  }
  printf("\n");
  return 0;
}
