#include <bits/stdc++.h>
using namespace std;
long long int a[51], b[51], p, n, m, t;
int main() {
  cin >> t;
  while (cin >> n >> m) {
    p++;
    if (a[n] != 1 && b[m] != 1) {
      cout << p << " ";
      a[n] = 1;
      b[m] = 1;
    }
  }
  cout << endl;
  return 0;
}
