#include <bits/stdc++.h>
const int MAXN = 50 + 10;
bool row[MAXN];
bool column[MAXN];
int main() {
  int n, x, y;
  std::cin >> n;
  for (int i = 0; i <= n * n; i++) {
    std::cin >> x >> y;
    if (row[x - 1] == false && column[y - 1] == false) {
      row[x - 1] = true;
      column[y - 1] = true;
      std::cout << i + 1 << " ";
    }
  }
  return 0;
}
