#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > M;
bool found;
vector<int> solu;
vector<int> usat;
bool be(int i, int j) {
  for (int x = 0; x < i; ++x) {
    int p = min(solu[x], j) + 1;
    if (M[i][x] != p) return false;
  }
  return true;
}
void f(int i) {
  if (not found) {
    if (i == n) {
      found = true;
      for (int j = 0; j < n; ++j) cout << (j == 0 ? "" : " ") << solu[j] + 1;
      cout << endl;
      return;
    }
    for (int j = 0; j < n; ++j) {
      if (not usat[j] and be(i, j)) {
        usat[j] = true;
        solu[i] = j;
        f(i + 1);
        usat[j] = false;
      }
    }
  }
}
int main() {
  cin >> n;
  found = false;
  M = vector<vector<int> >(n, vector<int>(n));
  solu = vector<int>(n);
  usat = vector<int>(n, false);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> M[i][j];
  f(0);
}
