#include <bits/stdc++.h>
using namespace std;
const int N = 1505;
const int mo = 998244353;
int n, m, a[N][N];
int fa[N], sz[N], S[N];
int f[N][N], tmp[N];
pair<int, int> e[N * N];
int get(int x) { return x == fa[x] ? x : fa[x] = get(fa[x]); }
void merge(int x, int y) {
  memset(tmp, 0, sizeof(tmp));
  for (int i = (int)(1); i <= (int)(sz[x]); i++)
    for (int j = (int)(1); j <= (int)(sz[y]); j++)
      tmp[i + j] = (tmp[i + j] + 1ll * f[x][i] * f[y][j]) % mo;
  memcpy(f[x], tmp, sizeof(f[x]));
  sz[x] += sz[y];
  S[x] += S[y];
  fa[y] = x;
}
bool cmp(pair<int, int> x, pair<int, int> y) {
  return a[x.first][x.second] < a[y.first][y.second];
}
int main() {
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(n); j++) scanf("%d", &a[i][j]);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(i + 1); j <= (int)(n); j++)
      e[++m] = pair<int, int>(i, j);
  sort(e + 1, e + m + 1, cmp);
  for (int i = (int)(1); i <= (int)(n); i++)
    fa[i] = i, sz[i] = 1, S[i] = 0, f[i][1] = 1;
  for (int i = (int)(1); i <= (int)(m); i++) {
    int x = get(e[i].first);
    int y = get(e[i].second);
    if (x != y) merge(x, y);
    ++S[x];
    if (S[x] == sz[x] * (sz[x] - 1) / 2) f[x][1] = (f[x][1] + 1) % mo;
  }
  for (int i = (int)(1); i <= (int)(n); i++) cout << f[get(1)][i] << ' ';
}
