#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2333, mod = 998244353;
long long n, a[maxn * maxn][2], A[maxn], f[maxn][maxn], sz1[maxn], sz2[maxn],
    fa[maxn];
inline long long find(long long x) {
  return fa[x] == x ? x : fa[x] = find(fa[x]);
}
inline long long read() {
  long long s = 0;
  char _ch = getchar();
  while (!('0' <= _ch && _ch <= '9')) _ch = getchar();
  while (('0' <= _ch && _ch <= '9')) s = s * 10 + _ch - 48, _ch = getchar();
  return s;
}
signed main() {
  n = read();
  for (register long long i = 1; i <= n; i++) {
    fa[i] = i, sz1[i] = 1, f[i][1] = 1;
    for (register long long j = 1; j <= n; j++) {
      long long x = read();
      if (i < j) a[x][0] = i, a[x][1] = j;
    }
  }
  for (register long long i = 1; i <= (n - 1) * n / 2; i++) {
    long long x = find(a[i][0]), y = find(a[i][1]);
    if (x != y) {
      for (register long long j = 0; j <= sz1[x]; j++)
        for (register long long k = 0; k <= sz1[y]; k++)
          A[j + k] = (A[j + k] + f[x][j] * f[y][k] % mod) % mod;
      for (register long long j = 1; j <= sz1[x] + sz1[y]; j++)
        f[x][j] = A[j], A[j] = 0;
      fa[y] = x;
      sz1[x] += sz1[y], sz2[x] += sz2[y] + 1;
    } else
      sz2[x]++;
    if ((sz1[x] - 1) * sz1[x] / 2 == sz2[x]) f[x][1]++;
  }
  for (register long long i = 1; i <= n; i++) cout << f[find(1)][i] << " ";
  cout << endl;
  return 0;
}
