#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
int a[100][100];
int n, x, y;
bool u[400], u1[400];
vector<int> v;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    cin >> x >> y;
    if (!u[x] && !u1[y]) {
      u[x] = 1;
      u1[y] = 1;
      v.push_back(i);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  return 0;
}
