#include <bits/stdc++.h>
using namespace std;
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>
void convolve(vector<T> &a, const vector<T> &b) {
  int sz = a.size();
  transform<B, P>(a.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);
}
}  // namespace bitwise_transform
const int mod = 998244353, B = 36, C = B / 2;
inline void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline int bp(int x) { return __builtin_popcount(x); }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<long long> b(B);
  for (long long i = 0, x; i < n; ++i) {
    cin >> x;
    for (int j = B - 1; j >= 0; --j)
      if ((x = min(x ^ b[j], x)) >> j & 1) {
        b[j] = x;
        break;
      }
  }
  int len = B - count(b.begin(), b.end(), 0LL);
  vector<int> y(1 << C);
  for (int i = 0; i < 1 << C; ++i) {
    int z = i;
    for (int j = C - 1; j >= 0; --j)
      if (z >> j & 1) z ^= b[j];
    if (!z) y[i] = 1;
  }
  bitwise_transform::transform<XOR, mod>(y.data(), 1 << C);
  vector<int> ans(m + 1);
  for (int k = 0; k <= C; ++k) {
    vector<int> x(1 << C);
    for (int i = 0; i < 1 << C; ++i)
      if (bp(i) == k) {
        long long z = (long long)i << C;
        for (int j = B - 1; j >= C; --j)
          if (z >> j & 1) z ^= b[j];
        if (!(z >> C)) x[z & ((1 << C) - 1)] += 1;
      }
    bitwise_transform::convolve<XOR, mod>(x, y);
    for (int i = (1 << C) - 1; i >= 0; --i)
      if (x[i]) add(ans[k + bp(i)], x[i]);
  }
  int p = pow_mod(2, n - len, mod);
  for (int i = 0; i <= m; ++i)
    cout << (long long)ans[i] * p % mod << " \n"[i == m];
  return 0;
}
