#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110000;
struct Node {
  int a, b, p;
} a[MAXN];
bool cmpa(const Node &a, const Node &b) {
  return a.a > b.a || a.a == b.a && a.b > b.b;
}
bool cmpb(const Node &a, const Node &b) {
  return a.b > b.b || a.b == b.b && a.a < b.a;
}
int main() {
  for (int N, P, K; ~scanf("%d %d %d", &N, &P, &K);) {
    for (int i = 0; i < N; ++i)
      scanf("%d %d", &a[i].a, &a[i].b), a[i].p = i + 1;
    sort(a, a + N, cmpb);
    sort(a, a + N - P + K, cmpa);
    vector<int> ans;
    int cnt = 0;
    Node cur = a[0];
    for (; cnt < K; ++cnt) {
      ans.push_back(a[cnt].p);
      if (cmpb(cur, a[cnt])) cur = a[cnt];
    }
    sort(a + K, a + N, cmpb);
    for (int i = K; i < N && cnt < P; ++i)
      if (!cmpb(a[i], cur)) ans.push_back(a[i].p), ++cnt;
    for (int i = 0; i < P; ++i) printf("%d%c", ans[i], i == P - 1 ? '\n' : ' ');
  }
  return 0;
}
