#include <bits/stdc++.h>
using namespace std;
struct order {
  int a, b;
  int index;
  int bdedaxiao;
};
bool cmp1(order x, order y) {
  if (x.b == y.b)
    return x.a > y.a;
  else
    return x.b < y.b;
}
bool cmp2(order x, order y) {
  if (x.a == y.a)
    return x.b > y.b;
  else
    return x.a > y.a;
}
int main() {
  int n, p, k;
  scanf("%d%d%d", &n, &p, &k);
  order x[n + 2];
  order ans[n + 2];
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i].a, &x[i].b);
    x[i].index = i;
  }
  sort(x + 1, x + n + 1, cmp1);
  for (int i = 1; i <= n; i++) {
    ans[i].index = x[i].index;
    ans[i].a = x[i].a;
    ans[i].b = x[i].b;
  }
  for (int i = 1; i <= n; i++) x[i].bdedaxiao = i;
  sort(x + p - k + 1, x + n + 1, cmp2);
  int t = n + 1;
  for (int i = p - k + 1; i <= p; i++) {
    printf("%d ", x[i].index);
    t = min(x[i].bdedaxiao, t);
  }
  for (int i = 1; i <= p - k; i++) printf("%d ", ans[t - i].index);
  printf("\n");
  return 0;
}
