#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  bool v[100], h[100];
  vector<int> ans;
  cin >> N;
  memset(v, false, sizeof(v));
  memset(h, false, sizeof(h));
  for (int i = 1; i <= N * N; i++) {
    int x, y;
    cin >> x >> y;
    if (v[x] == false && h[y] == false) {
      ans.push_back(i);
      v[x] = true;
      h[y] = true;
    }
  }
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
