#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3, LEN = 100;
int m[60];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  bool minus_one_used = false;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int number, d = 0;
    for (int i = 0; i <= n; i++) m[i] = 0;
    for (int j = 0; j < n; j++) {
      cin >> number;
      if (!m[number]) {
        m[number] = 1;
        d++;
      }
    }
    if (d == n) {
      if (!minus_one_used) {
        minus_one_used = true;
        cout << n - 1 << " ";
      } else {
        cout << n << " ";
      }
    } else {
      cout << d - 1 << " ";
    }
  }
  return 0;
}
