#include <bits/stdc++.h>
using namespace std;
struct Node {
  int id, a, b;
} node[111111], zhan[111111];
bool cmp1(Node a, Node b) { return a.a > b.a || (a.a == b.a && a.b > b.b); }
bool cmp2(Node a, Node b) { return a.b > b.b || (a.b == b.b && a.a < b.a); }
int main() {
  int n, p, k;
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 0; i < n; i++)
    scanf("%d%d", &node[i].a, &node[i].b), node[i].id = i + 1;
  sort(node, node + n, cmp2);
  sort(node, node + n - p + k, cmp1);
  int flag = 1 << 30, flag1 = -1;
  for (int i = 0; i < k; i++) {
    zhan[i] = node[i];
    if (flag >= zhan[i].b) {
      if (flag == zhan[i].b)
        flag1 = max(zhan[i].a, flag1);
      else
        flag1 = zhan[i].a;
      flag = zhan[i].b;
    }
  }
  sort(node + k, node + n, cmp2);
  int cnt = k;
  for (int i = k; cnt < p; i++) {
    if (node[i].b < flag || (node[i].b == flag && node[i].a >= flag1))
      zhan[cnt++] = node[i];
  }
  for (int i = 0; i < p; i++) printf("%d ", zhan[i].id);
  printf("\n");
}
