#include <bits/stdc++.h>
using namespace std;
int vish[100], visv[100];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    int h, v;
    scanf("%d%d", &h, &v);
    if (!vish[h] && !visv[v]) {
      vish[h] = visv[v] = 1;
      if (i != 1) printf(" ");
      printf("%d", i);
    }
  }
}
