#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int lin[N], col[N];
int main(void) {
  int n;
  cin >> n;
  for (int i = 0; i < n * n; ++i) {
    int a, b;
    cin >> a >> b;
    if (!lin[a] and !col[b]) {
      cout << (i + 1) << " ";
      lin[a] = col[b] = 1;
    }
  }
  return 0;
}
