#include <bits/stdc++.h>
using namespace std;
long long b_p(int a, int n) {
  long long p = 1;
  while (n > 0) {
    if (n % 2 == 0) {
      n /= 2;
      a *= a;
    } else {
      n--;
      p *= a;
    }
  }
  return p;
}
bool use[100];
bool us[100];
int main() {
  int n;
  cin >> n;
  int h, v;
  int ans[26000], k = 0;
  for (int i = 1; i <= n * n; i++) {
    cin >> h >> v;
    if (!use[h] && !us[v]) {
      ans[++k] = i;
      use[h] = 1;
      us[v] = 1;
    }
  }
  for (int i = 1; i <= k; i++) {
    cout << ans[i] << " ";
  }
}
