#include <bits/stdc++.h>
using namespace std;
struct P {
  int num, x, y;
};
P rec1[200000], rec2[200000];
bool been[200000], can[200000];
int minn;
int n, p, k, r;
bool cmp(P a, P b) {
  if (a.x < b.x) return true;
  if (a.x > b.x) return false;
  if (a.y < b.y) return true;
  return false;
}
bool cmp2(P a, P b) {
  if (a.y < b.y) return true;
  if (a.y > b.y) return false;
  if (a.x > b.x) return true;
  return false;
}
int main() {
  scanf("%d%d%d", &n, &p, &k);
  r = p - k;
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    rec2[i].num = rec1[i].num = i;
    rec2[i].x = rec1[i].x = x;
    rec2[i].y = rec1[i].y = y;
  }
  sort(rec2 + 1, rec2 + n + 1, cmp2);
  for (int i = 1; i <= r; i++) {
    can[rec2[i].num] = true;
  }
  sort(rec1 + 1, rec1 + n + 1, cmp);
  int l = k;
  for (int i = n; l != 0; i--) {
    int xx = rec1[i].num;
    if (!can[xx]) {
      printf("%d ", xx);
      been[xx] = true;
      l--;
    }
  }
  int no = 0;
  for (int i = n; i >= 1; i--) {
    if (been[rec2[i].num]) no = i;
  }
  for (int i = 1; i <= r; i++) {
    printf("%d ", rec2[no - i].num);
  }
}
