#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h, v, s[100] = {0}, d[100] = {0}, g = 0;
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    cin >> h >> v;
    g++;
    if (s[h] == 0 && d[v] == 0) {
      s[h] = 1;
      d[v] = 1;
      cout << g << " ";
    }
  }
  return 0;
}
