#include <bits/stdc++.h>
using namespace std;
const int N = 1505, M = N * N, mod = 998244353;
struct edge {
  int u, v, d;
  bool operator<(const edge &n) const { return d < n.d; }
} e[M];
int n, m, tot, rt, a[N][N], pa[N * 2], fa[N * 2], siz[N * 2], edg[N * 2],
    dp[N * 2][N], f[N];
vector<int> vec[N * 2];
int find(int u) { return u == pa[u] ? u : pa[u] = find(pa[u]); }
void dfs(int u) {
  dp[u][0] = 1;
  int sum = 0;
  for (int v : vec[u]) {
    dfs(v);
    for (int i = 0; i <= sum; i++) {
      for (int j = 1; j <= siz[v]; j++) {
        f[i + j] = (f[i + j] + 1LL * dp[u][i] * dp[v][j]) % mod;
      }
    }
    sum += siz[v];
    for (int i = 0; i <= sum; i++) {
      dp[u][i] = f[i];
      f[i] = 0;
    }
  }
  dp[u][1] = (edg[u] == siz[u] * (siz[u] - 1) / 2);
}
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++) {
      e[++m] = (edge){i, j, a[i][j]};
    }
  }
  for (int i = 1; i <= n; i++) {
    pa[i] = i;
    siz[i] = 1;
  }
  sort(e + 1, e + m + 1);
  tot = n;
  for (int i = 1; i <= m; i++) {
    int u = find(e[i].u), v = find(e[i].v);
    if (u == v) {
      edg[u]++;
    } else {
      tot++;
      pa[tot] = tot;
      fa[u] = fa[v] = pa[u] = pa[v] = tot;
      siz[tot] = siz[u] + siz[v];
      edg[tot] = edg[u] + edg[v] + 1;
    }
  }
  for (int i = 1; i <= tot; i++) {
    if (fa[i]) {
      vec[fa[i]].push_back(i);
    } else {
      rt = i;
    }
  }
  dfs(rt);
  for (int i = 1; i <= n; i++) {
    printf("%d ", dp[rt][i]);
  }
  puts("");
  return 0;
}
