#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
using li = long long;
using ld = long double;
void solve(bool);
void precalc();
clock_t start;
int main() {
  start = clock();
  int t = 1;
  cout.sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  precalc();
  while (t--) {
    solve(true);
  }
  cout.flush();
  return 0;
}
template <typename T>
T binpow(T q, T w, T mod) {
  if (!w) return 1 % mod;
  if (w & 1) return q * 1LL * binpow(q, w - 1, mod) % mod;
  return binpow(q * 1LL * q % mod, w / 2, mod);
}
template <typename T>
T gcd(T q, T w) {
  while (w) {
    q %= w;
    swap(q, w);
  }
  return q;
}
template <typename T>
T lcm(T q, T w) {
  return q / gcd(q, w) * w;
}
template <typename T>
void make_unique(vector<T>& vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
template <typename T>
void relax_min(T& cur, T val) {
  cur = min(cur, val);
}
template <typename T>
void relax_max(T& cur, T val) {
  cur = max(cur, val);
}
mt19937 rng(
    (unsigned long long)chrono::steady_clock::now().time_since_epoch().count());
void precalc() {}
const li mod = 998244353;
void add(li& cur, li val) {
  cur += val;
  cur %= mod;
}
void solve(__attribute__((unused)) bool read) {
  li n, m;
  if (read) {
    cin >> n >> m;
  } else {
    n = 200000;
    m = 35;
    n = rand() % 20 + 1;
    m = rand() % 35 + 1;
    n = 200000;
    m = 35;
  }
  vector<li> basis;
  vector<li> first_bit;
  li mult = 1;
  vector<li> inp;
  for (li w = 0; w < n; ++w) {
    li cur;
    if (read) {
      cin >> cur;
    } else {
      cur = 0;
      for (li j = 0; j < m; ++j) {
        if (j > 19) {
          break;
        }
        cur = cur * 2 + rand() % 2;
      }
      cur = (1LL << (w % m));
    }
    inp.push_back(cur);
    for (li i = 0; i < basis.size(); ++i) {
      if (cur & (1LL << first_bit[i])) {
        cur ^= basis[i];
      }
    }
    if (cur == 0) {
      mult = mult * 2 % mod;
      continue;
    }
    for (li i = 0; i < m; ++i) {
      if (cur & (1LL << i)) {
        first_bit.push_back(i);
        break;
      }
    }
    for (li i = 0; i < basis.size(); ++i) {
      if (basis[i] & (1LL << first_bit.back())) {
        basis[i] ^= cur;
      }
    }
    basis.push_back(cur);
  }
  li brute_value = (1LL << basis.size());
  li dp_value = (1LL << (m - (li)basis.size()));
  auto get_stupid = [&]() {
    vector<li> ans(m + 1, 0);
    for (li mask = 0; mask < (1 << inp.size()); ++mask) {
      li cur_res = 0;
      for (li i = 0; i < inp.size(); ++i) {
        if (mask & (1 << i)) {
          cur_res ^= inp[i];
        }
      }
      add(ans[__builtin_popcountll(cur_res)], 1);
    }
    return ans;
  };
  auto get_brute = [&]() {
    vector<li> ans(m + 1, 0);
    for (li mask = 0; mask < (1 << basis.size()); ++mask) {
      li cur_res = 0;
      for (li i = 0; i < basis.size(); ++i) {
        if (mask & (1 << i)) {
          cur_res ^= basis[i];
        }
      }
      add(ans[__builtin_popcountll(cur_res)], mult);
    }
    return ans;
  };
  auto get_dp = [&]() {
    vector<li> ans(m + 1, 0);
    vector<char> is_based(m, false);
    for (auto x : first_bit) {
      is_based[x] = true;
    }
    li par = 0;
    vector<vector<vector<li>>> dp(
        2, vector<vector<li>>(basis.size() + 1, vector<li>(dp_value, 0)));
    dp[par][0][0] = mult;
    for (li i = 0; i < basis.size(); ++i) {
      li rest_mask = 0;
      for (li j = 0; j < m; ++j) {
        if (!is_based[j]) {
          rest_mask = rest_mask * 2 + (bool)(basis[i] & (1LL << j));
        }
      }
      dp[par ^ 1] = dp[par];
      for (li ones = 0; ones < basis.size(); ++ones) {
        for (li mask = 0; mask < dp_value; ++mask) {
          add(dp[par ^ 1][ones + 1][mask ^ rest_mask], dp[par][ones][mask]);
        }
      }
      par ^= 1;
    }
    for (li ones = 0; ones <= basis.size(); ++ones) {
      for (li mask = 0; mask < dp_value; ++mask) {
        add(ans[ones + __builtin_popcountll(mask)], dp[par][ones][mask]);
      }
    }
    return ans;
  };
  vector<li> ans;
  if (brute_value <= dp_value * ((li)basis.size() + 1)) {
    ans = get_brute();
  } else {
    ans = get_dp();
  }
  if (read) {
    for (li x : ans) {
      cout << x << " ";
    }
    cout << "\n";
  }
}
