#include <bits/stdc++.h>
using namespace std;
const long long N = 5010, mod = 998244353;
long long n, inv[N], q[N], f[N][N];
long long Pow(long long x, long long y) {
  long long tmp = 1;
  while (y) {
    if (y & 1) tmp = tmp * x % mod;
    x = x * x % mod, y >>= 1;
  }
  return tmp;
}
long long C(long long x, long long y) {
  return q[x] * inv[y] % mod * inv[x - y] % mod;
}
signed main() {
  scanf("%lld", &n);
  q[0] = 1;
  for (long long i = 1; i <= n; ++i) q[i] = q[i - 1] * i % mod;
  inv[n] = Pow(q[n], mod - 2);
  for (long long i = n - 1; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
  for (long long i = 1; i <= n; ++i) f[i][0] = 1;
  for (long long i = 1; i <= n; ++i)
    for (long long j = 1; j < i; ++j)
      f[i][j] = ((j + 1) * f[i - 1][j] + (i - j) * f[i - 1][j - 1]) % mod;
  for (long long i = 0; i < n; ++i) {
    long long res = 0;
    for (long long j = i + 1; j <= n; ++j)
      res = (res + f[j][i] * C(n, j) % mod * q[n - j]) % mod;
    printf("%lld ", res);
  }
  return puts(""), 0;
}
