#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
struct node {
  int a, b, idx, pos;
} data[MAXN];
bool cmp1(const node &x, const node &y) {
  return x.b == y.b ? x.a > y.a : x.b < y.b;
}
bool cmp2(const node &x, const node &y) {
  return x.a == y.a ? x.pos > y.pos : x.a > y.a;
}
bool cmp3(const node &x, const node &y) { return x.pos < y.pos; }
int main() {
  int n, p, k;
  while (~scanf("%d%d%d", &n, &p, &k)) {
    for (int i = 1; i <= n; ++i) {
      scanf("%d%d", &data[i].a, &data[i].b);
      data[i].idx = i;
    }
    sort(data + 1, data + n + 1, cmp1);
    for (int i = 1; i <= n; ++i) data[i].pos = i;
    sort(data + p - k + 1, data + n + 1, cmp2);
    int pmin = n;
    for (int i = p - k + 1; i <= p; ++i) {
      printf("%d ", data[i].idx);
      pmin = min(pmin, data[i].pos);
    }
    sort(data + 1, data + n + 1, cmp3);
    for (int i = 1; i <= p - k; ++i) {
      if (i > 1) putchar(' ');
      printf("%d", data[pmin - i].idx);
    }
    putchar('\n');
  }
}
