#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i;
  cin >> N;
  vector<int> v;
  bool mark1[151], mark2[151];
  for (i = 1; i <= N; i++) {
    mark1[i] = false;
    mark2[i] = false;
  }
  for (i = 1; i <= N * N; i++) {
    int x, y;
    cin >> x >> y;
    if (mark1[x] == false && mark2[y] == false) {
      mark1[x] = true;
      mark2[y] = true;
      v.push_back(i);
    }
  }
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
