#include <bits/stdc++.h>
using namespace std;
struct Order {
  int a, b, id;
} order[1000010];
bool cmp1(Order o1, Order o2) {
  if (o1.a == o2.a && o1.b == o2.b) {
    return o1.id < o2.id;
  }
  if (o2.b == o1.b) return o1.a > o2.a;
  return o1.b < o2.b;
}
bool cmp2(Order o1, Order o2) {
  if (o1.a == o2.a && o1.b == o2.b) {
    return o1.id < o2.id;
  }
  if (o2.a == o1.a) return o2.b > o1.b;
  return o2.a > o1.a;
}
int ans[1000010];
bool vis[1000010];
int main() {
  int n, k, p, i, cnt;
  scanf("%d%d%d", &n, &p, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &order[i].a, &order[i].b);
    order[i].id = i;
  }
  sort(order + 1, order + 1 + n, cmp1);
  sort(order + p - k + 1, order + 1 + n, cmp2);
  i = n;
  cnt = 1;
  while (i > n - k) {
    vis[order[i].id] = true;
    i--;
  }
  sort(order + 1, order + 1 + n, cmp1);
  i = 1;
  while (i <= n && !vis[order[i].id]) i++;
  for (i--; i >= 1 && k < p; i--, k++) vis[order[i].id] = true;
  for (int i = 1; i <= n; i++)
    if (vis[i]) printf("%d ", i);
  puts("");
}
