#include <bits/stdc++.h>
using namespace std;
stack<int> nums;
stack<int> n2;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    vector<int> row;
    for (int j = 0; j < n; j++) {
      int a;
      cin >> a;
      row.push_back(a);
    }
    ans.push_back(*max_element(row.begin(), row.end()));
  }
  bool printed = false;
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i] == n - 1)
      if (!printed) {
        cout << ans[i] << " ";
        printed = true;
      } else
        cout << ans[i] + 1 << " ";
    else
      cout << ans[i] << " ";
  }
  return 0;
}
