#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
using ll = long long;
using P = pair<ll, ll>;
constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
constexpr ll mod17 = 1e9 + 7;
constexpr ll mod19 = 1e9 + 9;
constexpr ll mod9 = 998244353;
ll mod = mod17;
unordered_map<ll, ll> minvmap;
ll minv(ll a, ll m) {
  auto k = a;
  auto p = minvmap[a];
  if (p != 0) return p;
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    swap(a -= t * b, b);
    swap(u -= t * v, v);
  }
  p = (u % m + m) % m;
  minvmap[k] = p;
  return p;
}
struct mint {
  ll x;
  mint() : x(0) {}
  mint(ll x) : x((x % mod + mod) % mod) {}
  mint& fix() {
    x = (x % mod + mod) % mod;
    return *this;
  }
  mint operator-() const { return mint(0) - *this; }
  mint& operator+=(const mint& a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint& a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint& operator/=(const mint& a) {
    (x *= minv(a.x, mod)) %= mod;
    return *this;
  }
  mint operator+(const mint& a) const { return mint(*this) += a; }
  mint operator-(const mint& a) const { return mint(*this) -= a; }
  mint operator*(const mint& a) const { return mint(*this) *= a; }
  mint operator/(const mint& a) const { return mint(*this) /= a; }
  bool operator<(const mint& a) const { return x < a.x; }
  bool operator==(const mint& a) const { return x == a.x; }
};
template <typename T>
T mod_pow(T a, ll x) {
  T res = 1;
  while (x > 0) {
    if (x & 1) res *= a;
    a *= a;
    x >>= 1;
  }
  return res;
}
class combination {
 public:
  std::vector<mint> fact;

 public:
  std::vector<mint> inv;
  combination(int n) {
    fact.resize(n + 1);
    inv.resize(n + 1);
    fact[0] = 1;
    for (int i = 1; i <= n; i++) {
      fact[i] = fact[i - 1] * i;
    }
    inv[n] = mint(1) / fact[n];
    for (int i = n - 1; i >= 0; i--) {
      inv[i] = inv[i + 1] * (i + 1);
    }
  }

 public:
  mint get(int n, int r) {
    if (n < r || n < 0 || r < 0) return 0;
    return fact[n] * inv[r] * inv[n - r];
  }

 public:
  mint p(int n, int r) {
    if (n < r || n < 0) return 0;
    return fact[n] * inv[n - r];
  }
};
template <typename T>
void fwt_xor(vector<T>& f) {
  int n = f.size();
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j++) {
      if ((j & i) == 0) {
        T x = f[j], y = f[j | i];
        f[j] = x + y, f[j | i] = x - y;
      }
    }
  }
}
template <typename T>
void ifwt_xor(vector<T>& f) {
  int n = f.size();
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j++) {
      if ((j & i) == 0) {
        T x = f[j], y = f[j | i];
        f[j] = (x + y) / 2, f[j | i] = (x - y) / 2;
      }
    }
  }
}
template <typename T>
void fwt_or(vector<T>& f) {
  int n = f.size();
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j++) {
      if ((j & i) == 0) {
        f[j | i] += f[j];
      }
    }
  }
}
template <typename T>
void ifwt_or(vector<T>& f) {
  int n = f.size();
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j++) {
      if ((j & i) == 0) {
        f[j | i] -= f[j];
      }
    }
  }
}
template <typename T>
void fwt_and(vector<T>& f) {
  int n = f.size();
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j++) {
      if ((j & i) == 0) {
        f[j] += f[j | i];
      }
    }
  }
}
template <typename T>
void ifwt_and(vector<T>& f) {
  int n = f.size();
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j++) {
      if ((j & i) == 0) {
        f[j] -= f[j | i];
      }
    }
  }
}
class E1ChioriAndDollPickingEasyVersion {
 public:
  void solve(istream& cin, ostream& cout) {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    mod = mod9;
    int n, m;
    cin >> n >> m;
    vector<ll> a(n);
    for (int i = 0; i < (int)(n); i++) {
      cin >> a[i];
    }
    vector<ll> vec1, vec2;
    for (int k = m; k >= 0; k--) {
      ll t = 1LL << k;
      ll v = -1;
      for (int i = 0; i < (int)(n); i++) {
        if (t & a[i]) {
          if (v == -1) {
            v = a[i];
          }
          a[i] ^= v;
        }
      }
      if (v != -1) {
        if (k >= 18) {
          vec1.push_back(v);
        } else {
          vec2.push_back(v);
        }
      }
    }
    unordered_map<ll, ll> mp;
    mp[0] = 1;
    for (auto e : vec1) {
      auto mp2 = mp;
      for (auto f : mp) {
        mp2[f.first ^ e] += f.second;
      }
      swap(mp, mp2);
    }
    vector<vector<ll>> dp1(18, vector<ll>(1 << 18));
    for (auto e : mp) {
      int u = __builtin_popcount(e.first >> 18);
      int s = e.first % (1 << 18);
      dp1[u][s] += e.second;
    }
    mp.clear();
    mp[0] = 1;
    for (auto e : vec2) {
      auto mp2 = mp;
      for (auto f : mp) {
        mp2[f.first ^ e] += f.second;
      }
      swap(mp, mp2);
    }
    vector<ll> dp2(1 << 18);
    for (auto e : mp) {
      dp2[e.first] += e.second;
    }
    fwt_xor(dp2);
    for (int i = 0; i < (int)(18); i++) {
      fwt_xor(dp1[i]);
      for (int j = 0; j < (int)(1 << 18); j++) {
        dp1[i][j] *= dp2[j];
      }
      ifwt_xor(dp1[i]);
    }
    vector<mint> ans(36);
    for (int i = 0; i < (int)(18); i++) {
      for (int j = 0; j < (int)(1 << 18); j++) {
        ans[i + (__builtin_popcount(j))] += dp1[i][j];
      }
    }
    int p = n - vec1.size() - vec2.size();
    mint p2 = mod_pow(mint(2), p);
    for (int i = 0; i <= m; i++) {
      cout << (ans[i] * p2).x << ' ';
    }
    cout << endl;
  }
};
signed main() {
  E1ChioriAndDollPickingEasyVersion solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
