#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int n, i, a, b;
  scanf("%d", &n);
  int arr_h[51], arr_v[51];
  for (i = 1; i <= n; i++) {
    arr_h[i] = 0;
    arr_v[i] = 0;
  }
  for (i = 1; i <= n * n; i++) {
    scanf("%d%d", &a, &b);
    if (arr_h[b] == 0 && arr_v[a] == 0) {
      v.push_back(i);
      arr_h[b] = 1;
      arr_v[a] = 1;
    }
  }
  for (i = 0; i < v.size(); i++) printf("%d ", v[i]);
  printf("\n");
  return 0;
}
