#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
const int maxn = 100002;
int n;
set<int> col, row;
int days, x, y;
int main() {
  days = 1;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> x >> y;
    bool work1 = col.find(x) == col.end();
    bool work2 = row.find(y) == row.end();
    if (work1 && work2) {
      cout << days << " ";
      col.insert(x);
      row.insert(y);
    }
    days++;
  }
  cout << endl;
  return 0;
}
