#include <bits/stdc++.h>
using namespace std;
int n, m, p, k, ans;
int vis[100005];
struct Node {
  int a, b, id;
  int state;
} node[100005];
bool cmp1(const Node& x1, const Node& x2) {
  if (x1.b != x2.b) return x1.b < x2.b;
  if (x1.a != x2.a) return x1.a > x2.a;
  return x1.state < x2.state;
}
bool cmp2(const Node& x1, const Node& x2) {
  if (x1.a != x2.a) return x1.a > x2.a;
  return x1.b > x2.b;
}
int main() {
  int i, j, cnt, num;
  while (~scanf("%d%d%d", &n, &p, &k)) {
    memset(vis, 0, sizeof(vis));
    for (i = 1; i <= n; i++) {
      scanf("%d%d", &node[i].a, &node[i].b);
      node[i].id = i;
      node[i].state = 0;
    }
    sort(node + 1, node + n + 1, cmp1);
    for (i = 1; i <= p - k; i++) {
      node[i].state = 1;
    }
    sort(node + 1, node + n + 1, cmp2);
    cnt = 0;
    for (i = 1; cnt < k; i++) {
      if (!node[i].state) {
        cnt++;
        vis[node[i].id] = 1;
        node[i].state = 2;
        if (cnt == 1)
          printf("%d", node[i].id);
        else
          printf(" %d", node[i].id);
      }
    }
    sort(node + 1, node + n + 1, cmp1);
    cnt = num = 0;
    for (i = n; num < p - k; i--) {
      if (cnt >= k) {
        num++;
        printf(" %d", node[i].id);
      }
      if (vis[node[i].id]) cnt++;
    }
    printf("\n");
  }
  return 0;
}
