#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7, M = 998244353;
signed main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  ;
  int n;
  cin >> n;
  vector<pair<int, int> > edges(n * (n - 1) / 2);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      x--;
      if (i > j) edges[x] = {i, j};
    }
  vector<int> p(n), ecnt(n), sz(n, 1);
  vector<vector<int> > dp(n, vector<int>(n + 1));
  for (int i = 0; i < n; i++) dp[i][1] = 1;
  iota((p).begin(), (p).end(), 0);
  function<int(int)> find = [&](int u) {
    return p[u] == u ? u : p[u] = find(p[u]);
  };
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    int u = edges[i].first, v = edges[i].second;
    u = find(u), v = find(v);
    if (u != v) {
      if (sz[u] > sz[v]) swap(u, v);
      vector<int> nw_dp(n + 1);
      for (int x = 1; x <= sz[u]; x++)
        for (int y = 1; y <= min(n - x, sz[v]); y++)
          nw_dp[x + y] =
              (nw_dp[x + y] + (long long)dp[u][x] * dp[v][y] % M) % M;
      dp[v] = nw_dp;
      p[u] = v;
      sz[v] += sz[u], ecnt[v] += ecnt[u];
    }
    ecnt[v]++;
    if (ecnt[v] == sz[v] * (sz[v] - 1) / 2) dp[v][1] = (dp[v][1] + 1) % M;
  }
  int u = find(0);
  for (int i = 1; i <= n; i++) cout << dp[u][i] << " ";
  cout << endl;
}
