#include <bits/stdc++.h>
using namespace std;
const int MAX = 200005;
const int mod = 998244353;
vector<long long> b;
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
void Add(int &a, int b) { a = add(a, b); }
void add(long long first) {
  for (int i = 0; i < b.size(); i++) {
    long long t = b[i];
    if ((first ^ t) < first) {
      first ^= t;
    }
  }
  if (first == 0) return;
  for (int i = 0; i < b.size(); i++) {
    if ((first ^ b[i]) < b[i]) b[i] ^= first;
  }
  b.push_back(first);
  sort(b.begin(), b.end(), greater<long long>());
}
int mult(int first, int second) { return first * (long long)second % mod; }
int dp[1 << 15][21][21];
int ans[36];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    long long first;
    cin >> first;
    add(first);
  }
  int s1 = min(20, ((int)(b.size())));
  int v = (1 << 15) - 1;
  for (int i = 0; i < (1 << s1); i++) {
    long long first = 0;
    for (int j = 0; j < s1; j++)
      if (i & (1 << j)) first ^= b[j];
    dp[first & v][0][__builtin_popcountll(first >> 15)]++;
  }
  for (int l = 20; l < ((int)(b.size())); l++)
    for (int j = 0; j < (1 << 15); j++)
      for (int k = 0; k <= 20; k++) {
        Add(dp[j ^ b[l]][l - 19][k], dp[j][l - 20][k]);
        Add(dp[j][l - 19][k], dp[j][l - 20][k]);
      }
  for (int zsuv = 0; zsuv <= 20; zsuv++)
    for (int j = 0; j < (1 << 15); j++)
      Add(ans[__builtin_popcount(j) + zsuv],
          dp[j][max(((int)(b.size())) - 20, 0)][zsuv]);
  int first = 1;
  for (int i = 0; i < n - ((int)(b.size())); i++) Add(first, first);
  for (int i = 0; i <= m; i++) cout << mult(ans[i], first) << " ";
}
