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