#include <bits/stdc++.h>
using namespace std;
template <typename G>
struct triple {
  G first, second, T;
  triple(G x, G y, G z) : first(x), second(y), T(z) {}
  triple() : first(0), second(0), T(0) {}
};
template <typename T, typename U>
T pow_mod(T a, U b, int mod) {
  T r = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) r = (long long)r * a % mod;
    a = (long long)a * a % mod;
  }
  return r;
}
enum bit_op { AND, OR, XOR };
namespace bitwise_transform {
template <int P, typename T>
inline void fix(T &x) {
  if (x >= P)
    x -= P;
  else if (x < 0)
    x += P;
}
template <bit_op B, int P, bool inv = false, typename T>
void transform(T a[], int n) {
  for (int len = 1; len < n; len <<= 1)
    for (int i = 0; i < n; i += len << 1)
      for (int j = i; j < i + len; ++j) {
        T u = a[j], v = a[j + len];
        if (B == AND) a[j] = v - u * inv, a[j + len] = u + v * (!inv);
        if (B == OR) a[j] = u * (!inv) + v, a[j + len] = u - inv * v;
        if (B == XOR) a[j] = u + v, a[j + len] = u - v;
        if (P != -1) fix<P>(a[j]), fix<P>(a[j + len]);
      }
  if (B == XOR && inv) {
    int in = pow_mod(n, P - 2, P);
    for (int i = 0; i < n; ++i) {
      if (P == -1)
        a[i] /= n;
      else
        a[i] = (long long)a[i] * in % P;
    }
  }
}
template <bit_op B, int P = -1, typename T>
vector<T> convolve(vector<T> a, vector<T> b) {
  int n = max(a.size(), b.size()), sz = 1;
  while (sz < n) sz <<= 1;
  a.resize(sz);
  b.resize(sz);
  transform<B, P>(a.data(), sz);
  transform<B, P>(b.data(), sz);
  for (int i = 0; i < sz; i++) {
    if (P == -1)
      a[i] *= b[i];
    else
      a[i] = (long long)a[i] * b[i] % P;
  }
  transform<B, P, true>(a.data(), sz);
  return a;
}
}  // namespace bitwise_transform
inline void add(int &x, int y, int mod) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int M = 36, M2 = M / 2;
  const int mod = 998244353;
  int n, m;
  cin >> n >> m;
  vector<long long> v(M);
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    for (int j = M - 1; j >= 0; j--)
      if ((x = min(x, x ^ v[j])) & (1LL << j)) {
        v[j] = x;
        break;
      }
  }
  int sz = M;
  for (auto &i : v) sz -= (i == 0);
  vector<int> x(1 << M2);
  for (int i = 0; i < (1 << M2); i++) {
    int a = i;
    for (int j = M2 - 1; j >= 0; j--)
      if (a & (1 << j)) a ^= v[j];
    x[i] += (a == 0);
  }
  vector<int> ans(M + 1);
  for (int k = 0; k < M2; k++) {
    vector<int> y(1 << M2);
    for (int i = 0; i < (1 << M2); i++)
      if (__builtin_popcount(i) == k) {
        long long a = (long long)i << M2;
        for (int j = M - 1; j >= M2; j--)
          if (a & (1LL << j)) a ^= v[j];
        if (!(a >> M2)) ++y[a];
      }
    auto z = bitwise_transform::convolve<XOR, mod>(x, y);
    for (int i = 0; i < (1 << M2); i++)
      add(ans[k + __builtin_popcount(i)], z[i], mod);
  }
  int p = pow_mod(2, n - sz, mod);
  for (int i = 0; i <= m; i++)
    cout << (long long)ans[i] * p % mod << " \n"[i == m];
  return 0;
}
