#include <bits/stdc++.h>
using namespace std;
int n;
bool r[100], c[100];
int main() {
  cin >> n;
  vector<int> ans;
  for (int i = 1; i <= n * n; i++) {
    int x, y;
    cin >> x >> y;
    if (!r[x] && !c[y]) {
      ans.push_back(i);
      r[x] = true;
      c[y] = true;
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
