#include <bits/stdc++.h>
using namespace std;
bool row[51];
bool col[51];
int main() {
  memset(row, false, sizeof(row));
  memset(col, false, sizeof(col));
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int r, c;
    cin >> r >> c;
    if (row[r] == false && col[c] == false) {
      cout << i + 1 << " ";
      row[r] = true;
      col[c] = true;
    }
  }
  cout << endl;
  return 0;
}
