#include <bits/stdc++.h>
int p[5005][5005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    p[i][0] = 1;
    for (int j = 1; j < i; j++) {
      p[i][j] = ((long long)p[i - 1][j] * (j + 1) +
                 (long long)p[i - 1][j - 1] * (i - j)) %
                998244353;
    }
  }
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int now = 1;
    for (int j = n; j > i; j--) {
      ans += (long long)now * p[j][i] % 998244353;
      if (ans >= 998244353) {
        ans -= 998244353;
      }
      now = (long long)now * j % 998244353;
    }
    printf("%d", ans);
    if (i == n - 1) {
      putchar('\n');
    } else {
      putchar(' ');
    }
  }
  return 0;
}
