#include <bits/stdc++.h>
using namespace std;
int horizontal[55], vertical[55], days[110];
int main() {
  int n, counter = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    horizontal[i] = 0;
    vertical[i] = 0;
  }
  int x, y;
  for (int i = 0; i < n * n; i++) {
    scanf("%d %d", &x, &y);
    if (horizontal[y - 1] == 0 && vertical[x - 1] == 0) {
      horizontal[y - 1] = 1;
      vertical[x - 1] = 1;
      days[counter] = i + 1;
      counter++;
    }
  }
  for (int i = 0; i < counter; i++) printf("%d ", days[i]);
  return 0;
}
