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