#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(INT_MAX - 100);
const int N = (int)(0);
const long long mod = (int)(1e+9 + 7);
int main() {
  int n, num;
  cin >> n;
  bool ok = 0;
  for (int fil = 0; fil < n; fil++) {
    int M = 0;
    for (int col = 0; col < n; col++) {
      cin >> num;
      M = max(M, num);
    }
    cout << M + (M == n - 1 && ok) << " ";
    if (M == n - 1) ok = 1;
  }
  return 0;
}
