#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n * n], y[n * n];
  string X = " ", Y = " ";
  ostringstream ooo;
  for (int i = 0; i < n * n; i++) {
    cin >> x[i] >> y[i];
    ostringstream xx, yy;
    xx << " " << x[i] << " ";
    yy << " " << y[i] << " ";
    if (X.find(xx.str()) == -1 && Y.find(yy.str()) == -1) {
      ooo << i + 1 << " ";
      ostringstream o;
      o << x[i] << " ";
      ostringstream oo;
      oo << y[i] << " ";
      X += o.str();
      Y += oo.str() + " ";
    }
  }
  cout << ooo.str() << endl;
}
