#include <bits/stdc++.h>
using namespace std;
const int N = 5005, mod = 998244353;
int n;
int f[N][N], fac[N], inv[N];
inline long long qpow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) res = res * a % mod;
  return res;
}
int main() {
  scanf("%d", &n);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  inv[n] = qpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      f[i][j] =
          (1ll * (j + 1) * f[i - 1][j] + 1ll * (i - j) * f[i - 1][j - 1]) % mod;
    }
  }
  for (int i = 1; i <= n; i++) {
    int ans = 0;
    for (int j = 1; j <= n; j++)
      ans = (ans + 1ll * f[j][i - 1] * fac[n] % mod * inv[j] % mod) % mod;
    printf("%d ", ans);
  }
  return 0;
}
