#include <bits/stdc++.h>
using namespace std;
const int MAN = 100000 + 5;
int n, p, k;
struct coord {
  int x, y, in;
};
bool cmp1(coord left, coord right) {
  if (left.y < right.y) return true;
  if (left.y > right.y) return false;
  return (left.x > right.x);
}
bool cmp2(coord left, coord right) {
  if (left.y < right.y) return true;
  if (left.y > right.y) return false;
  return (left.x < right.x);
}
int i, mi, top;
coord a[MAN];
coord b[MAN];
int main() {
  scanf("%d%d%d", &n, &p, &k);
  for (i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i].x, &a[i].y);
    a[i].in = i;
  }
  sort(a + 1, a + n + 1, cmp1);
  for (i = (p - k + 1); i <= n; ++i) {
    ++top;
    b[top].y = a[i].x;
    b[top].x = i;
    b[top].in = a[i].in;
  }
  sort(b + 1, b + top + 1, cmp2);
  mi = n + 1;
  for (i = top; i >= top - k + 1; --i) {
    printf("%d ", b[i].in);
    if (mi > b[i].x) mi = b[i].x;
  }
  for (i = mi - 1; i >= mi - (p - k); --i) {
    printf("%d ", a[i].in);
  }
  printf("\n");
  return 0;
}
