#include <bits/stdc++.h>

#include <atcoder/modint>
using mint = atcoder::modint998244353;

template <class T, class F> void bitwise_transform(std::vector<T> &a, F f) {
  const int n = a.size();
  for (int w = 1; w < n; w *= 2) {
    for (int i = 0; i < n; i += w * 2) {
      for (int k = 0; k < w; k++) {
        f(a[i + k], a[i + w + k]);
      }
    }
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int N, M;
  std::cin >> N >> M;
  std::vector<int> L(M), R(M);
  for (int i = 0; i < M; i++) {
    std::cin >> L[i] >> R[i];
  }

  std::vector<mint> ans(1 << N, 1);
  for (int i = 0; i < M; i++) {
    std::vector<mint> b(1 << N);
    for (int k = L[i]; k <= R[i]; k++) {
      b[k] += 1;
    }
    bitwise_transform(b, [](auto &x, auto &y) {
      mint t = x - y;
      x += y;
      y = t;
    });
    for (int k = 0; k < 1 << N; k++) {
      ans[k] *= b[k];
    }
  }

  bitwise_transform(ans, [](auto &x, auto &y) {
    mint t = x - y;
    x += y;
    y = t;
  });

  const mint scale = 1 / mint(1 << N);
  for (int i = 0; i < 1 << N; i++) {
    std::cout << (ans[i] * scale).val() << "\n";
  }

  return 0;
}