#include <bits/stdc++.h>
using namespace std;
const int maxn = 60;
int a[maxn][maxn];
int res[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  bool b = 0;
  for (int i = 0; i < n; ++i) {
    int m = 0;
    for (int j = 0; j < n; ++j) {
      if (j != i && a[i][j] > m) {
        m = a[i][j];
      }
    }
    if (b) {
      cout << m << ' ';
    } else {
      if (m == n - 1) {
        cout << n << ' ';
        b = 1;
      } else {
        cout << m << ' ';
      }
    }
  }
  cout << '\n';
  return 0;
}
