#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
bool solve(vector<vector<int>>& g) {
  int n = g.size();
  vector<vector<int>> pos(n, vector<int>(n, -1));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - 1; j++) {
      pos[i][g[i][j]] = j;
    }
  }
  vector<vector<int>> gr(n, vector<int>(n - 1, 1));
  vector<int> First(n);
  vector<int> Second(n, 1);
  vector<int> Last(n, n - 2);
  auto rev = [&](int x, int y) {
    y = pos[x][y];
    gr[x][y] = 0;
    while (First[x] < n - 1 && gr[x][First[x]] == 0) First[x]++;
    Second[x] = max(Second[x], First[x] + 1);
    while (Second[x] < n - 1 && gr[x][Second[x]] == 0) Second[x]++;
    while (Last[x] >= 0 && gr[x][Last[x]] == 0) Last[x]--;
  };
  vector<int> propose(n);
  vector<int> received(n, -1);
  for (int i = 0; i < n; i++) {
    int v = i;
    while (true) {
      int p = propose[v];
      if (p == n - 1) return false;
      p = g[v][p];
      if (received[p] == -1) {
        received[p] = v;
        break;
      } else {
        int z = received[p];
        if (pos[p][v] < pos[p][z]) {
          received[p] = v;
          v = z;
        }
      }
      propose[v]++;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < propose[i]; j++) {
      rev(i, g[i][j]);
      rev(g[i][j], i);
    }
    assert(~received[i]);
    while (Last[i] >= 0 && g[i][Last[i]] != received[i]) {
      int v = g[i][Last[i]];
      rev(i, v);
      rev(v, i);
    }
    if (Last[i] == -1) return false;
  }
  while (true) {
    vector<int> to(n, -1);
    for (int i = 0; i < n; i++) {
      to[g[i][First[i]]] = i;
    }
    int root = -1;
    for (int i = 0; i < n; i++) {
      if (Second[i] < n - 1) root = i;
    }
    if (root == -1) break;
    vector<int> cycles = {root};
    vector<int> alive(n);
    alive[root] = 1;
    for (int b = 0; b < (int)cycles.size(); b++) {
      int v = cycles[b];
      assert(Second[v] < n - 1);
      int nxt = to[g[v][Second[v]]];
      if (!alive[nxt]) {
        cycles.push_back(nxt);
        alive[nxt] = 1;
      } else {
        root = nxt;
        break;
      }
    }
    reverse(cycles.begin(), cycles.end());
    while (cycles.back() != root) cycles.pop_back();
    for (int i : cycles) {
      int v = g[i][First[i]];
      rev(i, v);
      rev(v, i);
    }
    for (int i : cycles) {
      int v = g[i][First[i]];
      while (Last[v] >= 0 && g[v][Last[v]] != i) {
        int p = g[v][Last[v]];
        rev(v, p);
        rev(p, v);
      }
      if (Last[v] == -1) return false;
    }
  }
  for (int i = 0; i < n; i++) {
    int v = g[i][First[i]];
    assert(~v);
    g[i].clear();
    g[i].push_back(v);
  }
  return true;
}
int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n & 1) {
    cout << -1;
    return 0;
  }
  vector<vector<int>> g(n);
  for (int i = 0; i < n; i++) {
    vector<int> id;
    vector<int> cost(n);
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      cin >> cost[j];
      id.push_back(j);
    }
    sort(id.begin(), id.end(), [&](int x, int y) { return cost[x] < cost[y]; });
    g[i] = id;
  }
  if (!solve(g)) {
    cout << -1;
  } else {
    for (int i = 0; i < n; i++) cout << g[i][0] + 1 << "\n";
  }
  return 0;
}
