#include <bits/stdc++.h>
using namespace std;
int main() {
  int map[51][51];
  int count[51] = {0}, a[51] = {0};
  int max, ans, i, j, k, n, k1;
  bool f[51] = {false};
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) cin >> map[i][j];
  for (i = 1; i <= n; i++) {
    ans = 0;
    for (j = 1; j <= n; j++) count[j] = 0;
    for (j = 1; j <= n; j++)
      if (map[i][j] != 0) count[map[i][j]]++;
    for (j = 1; j <= n; j++)
      if (count[j] > 0) ans++;
    a[i] = ans;
    for (j = 1; j <= n - 1; j++)
      for (k = j + 1; k <= n; k++)
        if ((a[j] > 0) && (a[j] == a[k])) a[j] = n;
  }
  for (i = 1; i <= n - 1; i++) cout << a[i] << " ";
  cout << a[n] << endl;
}
