#include <bits/stdc++.h>
using namespace std;
std::mt19937 rnd(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 1500;
const int MOD = 998244353;
void inc(int& a, int b) {
  if ((a += b) >= MOD) a -= MOD;
}
int n;
int a[MAXN][MAXN];
int ans[MAXN + 1];
pair<int, pair<int, int>> e[MAXN * MAXN];
int ne;
int par[MAXN], sz[MAXN];
vector<int> ways[MAXN];
int cnt[MAXN];
int find(int a) { return par[a] == a ? a : par[a] = find(par[a]); }
void solve() {
  ne = 0;
  for (int i = (0); i < (n); ++i)
    for (int j = (i + 1); j < (n); ++j)
      e[ne++] = make_pair(a[i][j], make_pair(i, j));
  sort(e, e + ne);
  vector<int> one;
  one.push_back(0);
  one.push_back(1);
  for (int i = (0); i < (n); ++i)
    par[i] = i, sz[i] = 1, ways[i] = one, cnt[i] = 0;
  for (int i = (0); i < (ne); ++i) {
    int a = e[i].second.first, b = e[i].second.second;
    a = find(a), b = find(b);
    if (a != b) {
      vector<int> nways(((int)(ways[a]).size()) + ((int)(ways[b]).size()) - 1,
                        0);
      for (int j = (0); j < (((int)(ways[a]).size())); ++j)
        for (int k = (0); k < (((int)(ways[b]).size())); ++k)
          nways[j + k] =
              (nways[j + k] + (long long)ways[a][j] * ways[b][k]) % MOD;
      if (sz[a] < sz[b]) swap(a, b);
      par[b] = a, sz[a] += sz[b], ways[a] = nways, cnt[a] += cnt[b];
    }
    ++cnt[a];
    if (cnt[a] == sz[a] * (sz[a] - 1) / 2) inc(ways[a][1], 1);
  }
  int res = find(0);
  assert(((int)(ways[res]).size()) == n + 1);
  for (int i = (1); i <= (n); ++i) ans[i] = ways[res][i];
}
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i)
    for (int j = (0); j < (n); ++j) scanf("%d", &a[i][j]);
  solve();
  for (int i = (1); i <= (n); ++i) {
    if (i != 1) printf(" ");
    printf("%d", ans[i]);
  }
  puts("");
}
int main() {
  run();
  return 0;
}
