#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n, m;
int z = 15;
long long a[36];
long long b[65536];
long long c[65536];
long long d[65536];
long long ans[36];
vector<int> v[21];
long long pw(long long x, long long y) {
  if (y == 0) return 1;
  if (y % 2) return x * pw(x, y - 1) % mod;
  long long res = pw(x, y / 2);
  return res * res % mod;
}
void FWHT(long long* P, bool inverse) {
  for (int len = 1; 2 * len <= (1 << z); len <<= 1) {
    for (int i = 0; i < (1 << z); i += 2 * len) {
      for (int j = 0; j < len; j++) {
        long long u = P[i + j];
        long long v = P[i + len + j];
        P[i + j] = (u + v) % mod;
        P[i + len + j] = (u - v + mod) % mod;
      }
    }
  }
  long long god = pw((1 << z), mod - 2);
  if (inverse) {
    for (int i = 0; i < (1 << z); i++) P[i] = P[i] * god % mod;
  }
}
void conv() {
  FWHT(b, 0);
  for (int i = 0; i < (1 << z); i++) {
    d[i] = b[i] * c[i] % mod;
  }
  FWHT(d, 1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  int bona = 0;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    for (int i = m - 1; i >= 0; i--) {
      if (x & (1LL << i)) {
        if (a[i] == 0) {
          a[i] = x;
          break;
        } else
          x ^= a[i];
      }
    }
    if (x == 0) bona++;
  }
  z = 3 * m / 7;
  for (int i = 0; i < (1 << (m - z)); i++) {
    bool ok = true;
    long long x = 0;
    for (int j = z; j < m; j++) {
      if ((i & (1LL << (j - z))) == 0) continue;
      if (a[j] == 0) ok = false;
      x ^= a[j];
    }
    if (!ok) continue;
    int c = 0;
    for (int j = z; j < m; j++) {
      if (x & (1LL << j)) c++;
    }
    x &= (1 << z) - 1;
    v[c].push_back(x);
  }
  for (int i = 0; i < (1 << z); i++) {
    long long x = 0;
    bool ok = true;
    for (int j = 0; j < z; j++) {
      if ((i & (1LL << j)) == 0) continue;
      if (a[j] == 0) ok = false;
      x ^= a[j];
    }
    if (!ok) continue;
    c[x]++;
  }
  FWHT(c, 0);
  for (int i = 0; i <= m - z; i++) {
    for (int j = 0; j < (1 << z); j++) b[j] = 0;
    for (auto c : v[i]) b[c]++;
    conv();
    for (int j = 0; j < (1 << z); j++) {
      ans[i + __builtin_popcount(j)] += d[j];
    }
  }
  long long god = pw(2, bona);
  for (int i = 0; i <= m; i++) cout << ans[i] * god % mod << ' ';
}
