#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 100010;
int n, p, k;
struct node {
  int id, a, b;
} e[maxn];
bool cmp(node x, node y) {
  if (x.b == y.b) return x.a > y.a;
  return x.b < y.b;
}
bool cmp1(node x, node y) {
  if (x.a == y.a) return x.b < y.b;
  return x.a < y.a;
}
bool cmp2(node x, node y) {
  if (x.b == y.b) return x.a > y.a;
  return x.b < y.b;
}
signed main() {
  scanf("%d%d%d", &n, &p, &k);
  for (register int i = 1; i <= n; i++) {
    scanf("%d%d", &e[i].a, &e[i].b);
    e[i].id = i;
  }
  int tmp = p - k;
  sort(e + 1, e + 1 + n, cmp);
  sort(e + tmp + 1, e + 1 + n, cmp1);
  int mina = inf, minb = inf;
  for (register int i = n; i >= n - k + 1; i--) {
    if (minb > e[i].b) {
      minb = e[i].b;
      mina = e[i].a;
    } else if (minb == e[i].b) {
      if (e[i].a > mina) {
        mina = e[i].a;
      }
    }
  }
  tmp = n - k;
  sort(e + 1, e + 1 + tmp, cmp2);
  int pos = tmp;
  for (register int i = 1; i <= tmp; i++) {
    if (e[i].b > minb) {
      pos = i - 1;
      break;
    } else if (e[i].b == minb) {
      if (e[i].a < mina) {
        pos = i - 1;
        break;
      }
    }
  }
  tmp = p - k;
  for (register int i = pos; i >= pos - tmp + 1; i--) {
    printf("%d ", e[i].id);
  }
  for (register int i = n; i >= n - k + 1; i--) {
    printf("%d ", e[i].id);
  }
  return 0;
}
