#include <bits/stdc++.h>
using namespace std;
struct City {
  list<int> conns;
  vector<list<int>::iterator> connRanks;
  int outAccN = -1;
  int inAccN = -1;
  int inAccRank = INT32_MAX;
  list<int>::iterator toPropose;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  vector<City> cities;
  int n;
  cin >> n;
  cities.reserve(n + 1);
  cities.emplace_back();
  set<pair<int, int>> temp;
  for (int i = 1; i <= n; i++) {
    City ct;
    for (int j = 1; j <= n; j++) {
      if (i == j) {
        continue;
      }
      int x;
      cin >> x;
      temp.emplace(x, j);
    }
    ct.connRanks.resize(n + 1);
    for (auto &p : temp) {
      ct.conns.push_back(p.second);
      ct.connRanks[p.second] = std::next(ct.conns.end(), -1);
    }
    ct.toPropose = ct.conns.begin();
    temp.clear();
    cities.push_back(std::move(ct));
  }
  while (true) {
    bool changed = false;
    for (int i = 1; i <= n; i++) {
      auto &c = cities[i];
      if (c.outAccN == -1) {
        if (c.toPropose == c.conns.end()) {
          cout << -1 << endl;
          exit(EXIT_SUCCESS);
        }
        changed = true;
        auto &proposed = cities[*c.toPropose];
        auto limit =
            proposed.inAccN == -1
                ? proposed.conns.end()
                : (std::next(proposed.conns.begin(), proposed.inAccRank));
        auto it = std::find(proposed.conns.begin(), limit, i);
        if (it != limit) {
          if (proposed.inAccN != -1) {
            auto &left = cities[proposed.inAccN];
            left.outAccN = -1;
          }
          proposed.inAccN = i;
          proposed.inAccRank = std::distance(proposed.conns.begin(), it);
          c.outAccN = *c.toPropose;
        }
        c.toPropose++;
      }
    }
    if (!changed) break;
  }
  for (int i = 1; i <= n; i++) {
    auto &c = cities[i];
    auto it = c.conns.begin();
    while (it != c.conns.end() && *(it++) != c.inAccN)
      ;
    while (it != c.conns.end()) {
      auto &oth = cities[*it];
      oth.conns.erase(oth.connRanks[i]);
      it = c.conns.erase(it);
    }
  }
  bool rotation = true;
  while (rotation) {
    rotation = false;
    for (int i = 1; i <= n; i++) {
      if (cities[i].conns.size() < 2) continue;
      rotation = true;
      list<pair<int, int>> h;
      set<pair<int, int>> h_set;
      int cur = i;
      h.emplace_back(cur, *cities[cur].conns.begin());
      auto prev = h.begin();
      while (true) {
        int y = *std::next(cities[prev->first].conns.begin(), 1);
        int x = *cities[y].conns.rbegin();
        auto p = make_pair(x, y);
        if (h_set.count(p) != 0) {
          auto it = h.begin();
          while (*it != p) it = h.erase(it);
          break;
        }
        h.push_back(p);
        h_set.insert(p);
        prev++;
      }
      prev = h.end();
      prev--;
      for (auto it = h.begin(); it != h.end(); it++) {
        auto &yc = cities[it->second];
        auto &px = prev->first;
        auto rit = std::find(yc.conns.begin(), yc.conns.end(), px);
        if (rit == yc.conns.end()) {
          if (++prev == h.end()) {
            prev = h.begin();
          }
          continue;
        }
        rit++;
        while (rit != yc.conns.end()) {
          auto &oth = cities[*rit];
          oth.conns.erase(oth.connRanks[it->second]);
          rit = yc.conns.erase(rit);
        }
        if (++prev == h.end()) {
          prev = h.begin();
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (cities[i].conns.size() != 1) {
      cout << -1 << endl;
      exit(EXIT_SUCCESS);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << *cities[i].conns.begin() << endl;
  }
  return 0;
}
