#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, flag;
  cin >> n;
  int a, b;
  vector<int> h;
  vector<int> v;
  for (int i = 0; i < (n * n); i++) {
    cin >> a >> b;
    if (i == 0) {
      h.push_back(a);
      v.push_back(b);
      cout << "1"
           << " ";
      continue;
    } else {
      for (int j = 0; j < h.size(); j++) {
        if (a == h[j] || b == v[j]) flag = 1;
      }
    }
    if (flag == 1) {
      flag = 0;
    } else {
      h.push_back(a);
      v.push_back(b);
      cout << i + 1 << " ";
      flag = 0;
    }
  }
  cout << endl;
  return 0;
}
