#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxx = 100 + 5;
int vis1[maxx], vis2[maxx], l[51 * 51], r[51 * 51];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    memset(vis1, 0, sizeof(vis1));
    memset(vis2, 0, sizeof(vis2));
    for (int i = 1; i <= n * n; i++) scanf("%d%d", &l[i], &r[i]);
    for (int i = 1; i <= n * n; i++) {
      if (vis1[l[i]] == 0 && vis2[r[i]] == 0) {
        printf("%d ", i);
        vis1[l[i]] = 1, vis2[r[i]] = 1;
      }
    }
    printf("\n");
  }
  return 0;
}
