#include <bits/stdc++.h>
using namespace std;
const int N = 1505;
const long long mod = 998244353ll;
int n, a[N][N], u[N * N], v[N * N];
int sz1[N], sz2[N], fa[N], cnt = 0;
int findroot(int u) { return fa[u] == u ? u : fa[u] = findroot(fa[u]); }
vector<int> vec[N];
int sz[N], par[N << 1];
vector<int> child[N << 1];
long long f[N << 1][N << 1], tmp[N << 2];
void dfs(int u) {
  sz[u] = 1;
  for (int i = 0; i <= n; i++) f[u][i] = 0ll;
  f[u][0] = 1ll;
  for (int i = 0; i < child[u].size(); i++) {
    int v = child[u][i];
    dfs(v);
    for (int j = 0; j <= n; j++) tmp[j] = 0ll;
    for (int j = 0; j <= sz[u]; j++) {
      for (int k = 0; k <= sz[v]; k++) {
        tmp[j + k] = (tmp[j + k] + f[u][j] * f[v][k]) % mod;
      }
    }
    for (int j = 0; j <= n; j++) f[u][j] = tmp[j];
    sz[u] += sz[v];
  }
  f[u][0] = 0ll;
  f[u][1] = (f[u][1] + 1ll) % mod;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) scanf("%d", &a[i][j]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      u[a[i][j]] = i, v[a[i][j]] = j;
    }
  }
  cnt = n;
  for (int i = 1; i <= n; i++) sz1[i] = 1, sz2[i] = 0, fa[i] = i;
  for (int i = 1; i <= n * (n - 1) / 2; i++) {
    int x = u[i], y = v[i];
    int rx = findroot(x), ry = findroot(y);
    if (rx == ry)
      sz2[rx]++;
    else {
      sz1[rx] += sz1[ry];
      sz2[rx] += sz2[ry] + 1;
      fa[ry] = rx;
    }
    if (sz2[rx] == sz1[rx] * (sz1[rx] - 1) / 2) {
      cnt++;
      for (int j = 1; j <= n; j++) {
        if (findroot(j) == rx) vec[j].push_back(cnt);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vec[i].empty()) continue;
    par[i] = vec[i][0];
    for (int j = 0; j < (int)vec[i].size() - 1; j++)
      par[vec[i][j]] = vec[i][j + 1];
  }
  for (int i = 1; i < cnt; i++) child[par[i]].push_back(i);
  dfs(cnt);
  for (int i = 1; i <= n; i++) printf("%lld ", f[cnt][i]);
  printf("\n");
  return 0;
}
