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