#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, who[N], a[N][N];
bool ban[N][N];
deque<int> pref[N];
void GG() { puts("-1"), exit(0); }
void clip(int k1) {
  while (((int)(pref[k1]).size()) && ban[k1][pref[k1].front()])
    pref[k1].pop_front();
  while (((int)(pref[k1]).size()) && ban[k1][pref[k1].back()])
    pref[k1].pop_back();
  if (!((int)(pref[k1]).size())) GG();
}
void del(int k1, int k2) { ban[k1][k2] = ban[k2][k1] = 1; }
void add(int k1, int k2) {
  who[k2] = k1;
  while (1) {
    ((void)0);
    clip(k2);
    if (pref[k2].back() != k1)
      del(pref[k2].back(), k2);
    else
      break;
  }
}
void work1() {
  queue<int> q;
  for (int i = (1); i <= (n); ++i) q.push(i);
  while (((int)(q).size())) {
    int k1 = q.front();
    ((void)0);
    q.pop();
    while (1) {
      ((void)0);
      clip(k1);
      int hsf = 1;
      int k2 = pref[k1].front(), k3 = who[k2];
      if (k3 && a[k2][k3] < a[k2][k1]) {
        del(k1, k2);
        continue;
      }
      if (k3) {
        who[k2] = 0, q.push(k3);
      }
      add(k1, k2);
      break;
    }
  }
}
int nex(int k1) {
  clip(k1);
  int k2 = pref[k1].front();
  pref[k1].pop_front();
  clip(k1);
  pref[k1].push_front(k2);
  return who[pref[k1][1]];
}
void work2() {
  int cur = 1;
  while (1) {
    ((void)0);
    for (; cur <= n; ++cur) {
      clip(cur);
      if (((int)(pref[cur]).size()) > 1) break;
    }
    if (cur > n) {
      for (int i = (1); i <= (n); ++i) printf("%d\n", pref[i].front());
      puts("");
      exit(0);
    }
    vector<int> cyc, CYC;
    {
      int k1 = cur, k2 = cur;
      do k1 = nex(k1), k2 = nex(nex(k2));
      while (k1 != k2);
      do cyc.push_back(k2), k2 = nex(k2);
      while (k1 != k2);
    }
    for (auto k1 : cyc) {
      int k2 = pref[k1][0];
      CYC.push_back(k2);
      who[k2] = 0;
      del(k1, k2);
    }
    for (int i = (0); i <= (((int)(cyc).size()) - 1); ++i) {
      add(cyc[i], CYC[(i + 1) % ((int)(CYC).size())]);
    }
  }
}
int main() {
  scanf("%d", &n);
  if (n & 1) GG();
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (n); ++j)
      if (i != j) scanf("%d", &a[i][j]), pref[i].push_back(j);
    sort(pref[i].begin(), pref[i].end(),
         [&](int k1, int k2) { return a[i][k1] < a[i][k2]; });
  }
  work1();
  work2();
  return 0;
}
