#include <bits/stdc++.h>
using namespace std;
int n;
int r[55], c[55];
vector<int> ans;
int main() {
  int x, y;
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) {
    scanf("%d%d", &x, &y);
    if (r[x] == 0 && c[y] == 0) {
      r[x] = 1;
      c[y] = 1;
      ans.push_back(i);
    }
  }
  for (int i = 0; i <= ans.size() - 1; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
