#include <bits/stdc++.h>
const int N = 100000;
struct ab_t {
  int a, b;
};
ab_t e[N];
int as[N], ax[N], bs[N], bx[N], se[N], si = 0;
int cmp_as(const void* p1, const void* p2) {
  const int i1 = *(const int*)p1, i2 = *(const int*)p2;
  if (e[i1].a > e[i2].a)
    return -1;
  else if (e[i1].a == e[i2].a) {
    if (e[i1].b > e[i2].b)
      return -1;
    else if (e[i1].b == e[i2].b)
      return 0;
  }
  return 1;
}
int cmp_bs(const void* p1, const void* p2) {
  const int i1 = *(const int*)p1, i2 = *(const int*)p2;
  if (e[i1].b > e[i2].b)
    return -1;
  else if (e[i1].b == e[i2].b) {
    if (e[i1].a < e[i2].a)
      return -1;
    else if (e[i1].a == e[i2].a) {
      if (ax[i1] < ax[i2]) return -1;
    }
  }
  return 1;
}
int main() {
  int n, p, k;
  scanf("%d%d%d", &n, &p, &k);
  int i = -1;
  while (++i < n) scanf("%d%d", &e[i].a, &e[i].b);
  i = -1;
  while (++i < n) as[i] = bs[i] = i;
  qsort(as, n, sizeof(int), cmp_as);
  i = -1;
  while (++i < n) ax[as[i]] = i;
  qsort(bs, n, sizeof(int), cmp_bs);
  i = -1;
  while (++i < n) bx[bs[i]] = i;
  i = 0;
  int pk = p - k, n1 = n - 1, mb = -1, lb = n1 - pk;
  int ai = 0;
  while (i < k) {
    int j = as[ai];
    j = bx[j];
    if (j > lb) {
      ++ai;
    } else {
      if (mb < j) mb = j;
      se[i++] = as[ai];
      ++ai;
    }
  }
  while (i < p) {
    int j = bs[++mb];
    se[i++] = j;
  }
  i = -1;
  --p;
  while (++i < p) printf("%d ", se[i] + 1);
  printf("%d\n", se[i] + 1);
  return 0;
}
