#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int maxn = 1579;
vector<vector<long long>> dp(maxn, vector<long long>(2, 0));
vector<int> s(maxn, 1), e(maxn, 0), p(maxn);
int highest(int a) {
  while (a != p[a]) a = p[a];
  return a;
}
void merge(int a, int b) {
  a = highest(a), b = highest(b);
  if (a != b) {
    if (s[a] < s[b]) swap(a, b);
    vector<long long> nwdp(s[a] + s[b] + 1, 0);
    for (int cnta = 1; cnta <= s[a]; cnta++) {
      for (int cntb = 1; cntb <= s[b]; cntb++) {
        nwdp[cnta + cntb] =
            (nwdp[cnta + cntb] + (dp[a][cnta] * dp[b][cntb]) % mod) % mod;
      }
    }
    dp[a] = nwdp;
    s[a] += s[b], p[b] = a;
    e[a] += e[b];
  }
  e[a]++;
  if (e[a] == (s[a] * (s[a] - 1)) / 2) dp[a][1]++;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < maxn; i++) p[i] = i, dp[i][1] = 1;
  int n;
  cin >> n;
  vector<pair<int, int>> ed((n * (n - 1)) / 2 + 1, {-1, -1});
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int a;
      cin >> a;
      ed[a] = {i, j};
    }
  }
  for (int i = 1; i <= (n * (n - 1)) / 2; i++) {
    merge(ed[i].first, ed[i].second);
  }
  int boss = highest(0);
  for (int i = 1; i <= n; i++) cout << dp[boss][i] << " ";
  cout << "\n";
  return 0;
}
