#include <bits/stdc++.h>
using namespace std;
const int maxn = 1555, mod = 998244353;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 0;
  while (ch < '0' || ch > '9') f |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f ? -x : x;
}
inline int qmo(int x) { return x + (x >> 31 ? mod : 0); }
struct edge {
  int u, v, w;
  bool operator<(const edge &e) const { return w < e.w; }
} e[maxn * maxn / 2];
int n, el, cnt, fa[maxn * 2], f[maxn * 2][maxn], sz[maxn * 2], ls[maxn * 2],
    rs[maxn * 2], ec[maxn * 2];
int getfa(int x) { return x == fa[x] ? x : fa[x] = getfa(fa[x]); }
void dfs(int u) {
  if (ls[u] || rs[u]) {
    assert(ls[u] && rs[u]);
    dfs(ls[u]);
    dfs(rs[u]);
    sz[u] += sz[ls[u]] + sz[rs[u]];
    for (int i = (1); i <= (sz[ls[u]]); i++)
      for (int j = (1); j <= (sz[rs[u]]); j++)
        f[u][i + j] = (f[u][i + j] + 1ll * f[ls[u]][i] * f[rs[u]][j]) % mod;
  } else
    sz[u] = 1;
  if (ec[u] == sz[u] * (sz[u] - 1) / 2) f[u][1] = (f[u][1] + 1) % mod;
}
int main() {
  cnt = n = read();
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (n); j++) {
      int x = read();
      if (i < j) e[++el] = (edge){i, j, x};
    }
  sort(e + 1, e + el + 1);
  for (int i = (1); i <= (2 * n); i++) fa[i] = i;
  for (int i = (1); i <= (el); i++) {
    int u = e[i].u, v = e[i].v;
    u = getfa(u);
    v = getfa(v);
    if (u == v) {
      ec[u]++;
      continue;
    }
    fa[u] = fa[v] = ++cnt;
    ls[cnt] = u;
    rs[cnt] = v;
    ec[cnt] = ec[u] + ec[v] + 1;
  }
  dfs(cnt);
  for (int i = (1); i <= (n); i++) printf("%d ", f[cnt][i]);
}
