#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool h[51];
  bool v[51];
  for (int i = 0; i < 51; ++i) {
    h[i] = false;
    v[i] = false;
  }
  int x, y;
  for (int i = 0; i < n * n; ++i) {
    cin >> x >> y;
    if (!h[x] and !v[y]) {
      cout << i + 1 << " ";
      h[x] = true;
      v[y] = true;
    }
  }
  return 0;
}
