#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592654;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
int main() {
  fast();
  int x;
  cin >> x;
  vector<int> v(x);
  map<int, int> mp;
  vector<int> test;
  set<int> st;
  for (int(i) = 0; (i) < (long long)(x); (i)++) {
    for (int(j) = 0; (j) < (long long)(x); (j)++) cin >> v[j];
    mp[*max_element((v).begin(), (v).end())]++;
    if (mp[*max_element((v).begin(), (v).end())] > 1) {
      set<int> st((v).begin(), (v).end());
      test.push_back(st.size());
      v.clear(), v.resize(x);
      continue;
    }
    test.push_back(*max_element((v).begin(), (v).end()));
    v.clear(), v.resize(x);
  }
  for (int(i) = 0; (i) < (long long)(x); (i)++) cout << test[i] << " ";
  cout << endl;
  return 0;
}
