#include <bits/stdc++.h>
using namespace std;
int a[100], b[100];
int main() {
  int n;
  scanf("%d", &n);
  n = n * n;
  for (int j = 1; j <= n; ++j) {
    int x, y;
    scanf("%d%d", &x, &y);
    if (a[x] == 0 && b[y] == 0) {
      printf("%d ", j);
      a[x] = 1;
      b[y] = 1;
    }
  }
  printf("\n");
  return 0;
}
