#include <bits/stdc++.h>
using namespace std;
bool u[2][100];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n * n; ++i) {
    int h, v;
    cin >> h >> v;
    --h;
    --v;
    if (u[0][h] != true && u[1][v] != true) {
      u[0][h] = true;
      u[1][v] = true;
      cout << i + 1 << " ";
    }
  }
  return 0;
}
