#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
  vector<int> f, setSize, edgesOfComp;
  vector<vector<long long>> waysOfComp;
  int cantSets, N;
  void init(int n) {
    N = n;
    f.clear();
    setSize.clear();
    cantSets = n;
    f.resize(n, -1);
    setSize.resize(n, 1);
    edgesOfComp.resize(n, 0);
    waysOfComp.resize(n, vector<long long>(n + 1, 0));
    for (int i = (0); i < (n); i++) waysOfComp[i][1] = 1;
  }
  int comp(int x) { return (f[x] == -1 ? x : f[x] = comp(f[x])); }
  bool join(int i, int j) {
    int a = comp(i), b = comp(j), curComp;
    if (a != b) {
      cantSets--;
      if (setSize[a] > setSize[b]) swap(a, b);
      int sza = setSize[a], szb = setSize[b];
      assert(waysOfComp[a][sza] == 1);
      assert(waysOfComp[b][szb] == 1);
      vector<long long> aux;
      for (int i = (1); i < (sza + szb + 1); i++) {
        int ka = 0, kb = i;
        if (kb > szb) {
          ka += kb - szb;
          kb = szb;
        }
        if (ka > sza) break;
        aux.push_back(0);
        while (ka <= sza && kb > 0) {
          aux.back() =
              (aux.back() + waysOfComp[a][ka] * waysOfComp[b][kb]) % 998244353;
          ka++;
          kb--;
        }
      }
      for (int i = (0); i < (((int)aux.size())); i++)
        waysOfComp[b][i + 1] = aux[i];
      setSize[b] += setSize[a];
      edgesOfComp[b] += edgesOfComp[a] + 1;
      curComp = f[a] = b;
    } else
      edgesOfComp[a]++, curComp = a;
    assert(waysOfComp[curComp][0] == 0);
    assert(waysOfComp[curComp][1] == 0);
    if (edgesOfComp[curComp] ==
        setSize[curComp] * (long long)(setSize[curComp] - 1) / 2)
      waysOfComp[curComp][1] = 1;
    return a == b;
  }
};
struct edge {
  int a, b, w;
};
bool cmp(edge &a, edge &b) { return a.w < b.w; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<edge> v;
  v.reserve(n * n / 2);
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (n); j++) {
      int x;
      cin >> x;
      if (j > i) v.push_back({i, j, x});
    }
  sort(v.begin(), v.end(), cmp);
  UnionFind dsu;
  dsu.init(n);
  for (auto it = v.begin(); it != v.end(); it++) dsu.join(it->a, it->b);
  int comp = dsu.comp(0);
  for (int i = (1); i < (n + 1); i++) cout << dsu.waysOfComp[comp][i] << ' ';
  cout << '\n';
  return 0;
}
