#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<vector<int>> arr(k, vector<int>(2));
  for (int i = 0; i < k; i++) {
    cin >> arr[i][0] >> arr[i][1];
  }
  set<int> val;
  for (int i = 0; i < k; i++) {
    int s = arr[i][0];
    int e = arr[i][1];
    for (int j = s; j <= e; j++) {
      val.insert(j);
    }
  }
  vector<int> dp(n + 1);
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    for (auto j : val) {
      if (i >= j) {
        dp[i] = (dp[i] + dp[i - j]) % 998244353;
      } else {
        break;
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    cout << dp[i] << " ";
  }
  cout << endl;
  return 0;
}
