#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int Mod = (int)1e9 + 7;
int vx[100], vy[100];
int main() {
  int n;
  cin >> n;
  for (int i = 1, x, y; i <= n * n; ++i) {
    cin >> x >> y;
    if (!vx[x] && !vy[y]) {
      vx[x] = vy[y] = 1;
      cout << i << " ";
    }
  }
}
