#include <bits/stdc++.h>
using namespace std;
struct ppp {
  int x, y, id;
} a[120000], b[120000];
int i, j, k, l, n, m, p, t;
bool cmp(const ppp& a, const ppp& b) {
  return a.y < b.y || a.y == b.y && a.x > b.x;
}
bool cmp2(const ppp& a, const ppp& b) {
  return a.x > b.x || a.x == b.x && a.y > b.y;
}
int main() {
  scanf("%d%d%d", &n, &p, &m);
  for (i = 1; i <= n; ++i) scanf("%d%d", &a[i].x, &a[i].y), a[i].id = i;
  sort(a + 1, a + n + 1, cmp);
  p -= m;
  for (i = p + 1; i <= n; ++i) b[i].x = a[i].x, b[i].y = i;
  sort(b + p + 1, b + n + 1, cmp2);
  t = n;
  for (i = p + 1; i <= p + m; ++i) {
    t = min(t, b[i].y);
    printf("%d ", a[b[i].y].id);
  }
  for (i = 1; i <= p; ++i) printf("%d ", a[t - i].id);
}
