#include <bits/stdc++.h>
using namespace std;
int n;
int C[5005][5005], E[5005][5005], fac[5005];
int main() {
  scanf("%d", &n);
  for (int i = C[0][0] = E[0][0] = 1; i <= n; i++)
    for (int j = C[i][0] = E[i][0] = 1; j <= i; j++) {
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 998244353;
      E[i][j] =
          (1ll * (j + 1) * E[i - 1][j] + 1ll * (i - j) * E[i - 1][j - 1]) %
          998244353;
    }
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % 998244353;
  for (int i = 1; i <= n; i++) {
    int ans = 0;
    for (int j = i; j <= n; j++)
      ans = (ans + 1ll * E[j][i - 1] * C[n][j] % 998244353 * fac[n - j]) %
            998244353;
    printf("%d%c", ans, " \n"[n == i]);
  }
}
