#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    int Max = 0;
    for (int j = 0; j < n; ++j) {
      int x;
      cin >> x;
      Max = max(x, Max);
    }
    if (flag && Max == n - 1) {
      cout << Max + 1 << ' ';
      flag = false;
    } else {
      cout << Max << ' ';
    }
  }
  return 0;
}
