#include <bits/stdc++.h>
using namespace std;
const int N = 1600;
const int N2 = N + N;
const int md = 998244353;
vector<array<int, 2> > vc;
vector<int> g[N2];
int nm[N], a[N][N], n, cmps, pre[N], siz[N2], edg[N], id[N];
int dp[N2][N], full[N];
bool ok[N2];
int get(int x) { return (pre[x] == x ? x : pre[x] = get(pre[x])); }
int sum(int x, int y) {
  x += y;
  if (x >= md) x -= md;
  return x;
}
void SUM(int &x, int y) {
  x += y;
  if (x >= md) x -= md;
}
int mult(int x, int y) { return (1ll * x * y) % md; }
void dfs(int v) {
  siz[v] = bool(v < n);
  dp[v][0] = 1;
  for (int u : g[v]) {
    dfs(u);
    siz[v] += siz[u];
    for (int old = siz[v]; old >= 0; old--) {
      dp[v][old] = 0;
      for (int sz = 1; sz <= siz[u]; sz++) {
        if (old - sz < 0) continue;
        SUM(dp[v][old], mult(dp[v][old - sz], dp[u][sz]));
      }
    }
  }
  if (ok[v]) SUM(dp[v][1], 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) full[i] = i * (i - 1) / 2;
  vc.resize(full[n]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) vc[a[i][j] - 1] = {i, j};
  for (int i = 0; i < n; i++) {
    pre[i] = i;
    ok[i] = 1;
    siz[i] = 1;
    edg[i] = 0;
    id[i] = i;
  }
  cmps = n;
  for (array<int, 2> cr : vc) {
    int x = cr[0], y = cr[1];
    int xx = get(x), yy = get(y);
    if (xx == yy) {
      edg[xx]++;
      if (edg[xx] == full[siz[xx]]) ok[id[xx]] = 1;
    } else {
      if (siz[xx] > siz[yy]) swap(xx, yy);
      pre[xx] = pre[yy];
      siz[yy] += siz[xx];
      g[cmps].push_back(id[xx]);
      g[cmps].push_back(id[yy]);
      id[yy] = cmps;
      edg[yy] += edg[xx] + 1;
      if (edg[yy] == full[siz[yy]]) ok[id[yy]] = 1;
      cmps++;
    }
  }
  dfs(cmps - 1);
  for (int i = 1; i <= n; i++) cout << dp[cmps - 1][i] << " ";
  return 0;
}
