#include <bits/stdc++.h>
using namespace std;
long long n, kq[1000000 + 1];
void doc() {
  bool kt = false;
  cin >> n;
  long long x;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> x;
      kq[i] = max(kq[i], x);
    }
    if (kt == false and kq[i] == n - 1) kq[i]++, kt = true;
    cout << kq[i] << " ";
  }
}
void xl() {}
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  doc();
  xl();
}
