#include <bits/stdc++.h>
using namespace std;
int n;
bool a[100], b[100];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int I = 0, i, j; I < n * n; I++) {
    cin >> i >> j;
    i--;
    j--;
    if (a[i] == 0 && b[j] == 0) {
      b[j] = 1;
      a[i] = 1;
      cout << I + 1 << " ";
    }
  }
}
