#include <bits/stdc++.h>
using namespace std;
struct order {
  int id, grey, displease, flag1, flag2;
} x[100010], y[100010];
int n, p, k, check[100010];
bool cmp1(order xx, order yy) {
  if (xx.displease == yy.displease) return xx.grey > yy.grey;
  return xx.displease < yy.displease;
}
bool cmp2(order xx, order yy) {
  if (xx.grey == yy.grey) return xx.displease > yy.displease;
  return xx.grey > yy.grey;
}
bool cmp3(order xx, order yy) {
  if (xx.displease == yy.displease) return xx.grey > yy.grey;
  return xx.displease > yy.displease;
}
int main() {
  scanf("%d%d%d", &n, &p, &k);
  memset(check, 0, sizeof(check));
  for (int i = 1; i <= n; i++) {
    int tmpx, tmpy;
    scanf("%d%d", &tmpx, &tmpy);
    x[i].id = y[i].id = i;
    x[i].grey = y[i].grey = tmpx;
    x[i].displease = y[i].displease = tmpy;
    x[i].flag1 = y[i].flag1 = 0;
    x[i].flag2 = y[i].flag2 = 0;
  }
  sort(y + 1, y + 1 + n, cmp1);
  for (int i = 1; i <= p - k; i++) {
    y[i].flag2 = 1;
    check[y[i].id] = 1;
  }
  int minn = 0x3f3f3f3f;
  int maxx;
  int cnt = 0;
  sort(x + 1, x + 1 + n, cmp2);
  for (int i = 1; i <= n; i++) {
    if (cnt == k) break;
    if (check[x[i].id] == 1) continue;
    if (x[i].displease > y[p - k].displease) {
      cnt++;
      if (minn > x[i].displease) {
        minn = x[i].displease;
        maxx = x[i].grey;
      } else if (minn == x[i].displease && maxx < x[i].grey)
        maxx = x[i].grey;
      x[i].flag1 = 1;
      check[x[i].id] = 1;
    } else if (x[i].displease == y[p - k].displease) {
      if (x[i].grey <= y[p - k].grey) {
        cnt++;
        if (minn > x[i].displease) {
          minn = x[i].displease;
          maxx = x[i].grey;
        } else if (minn == x[i].displease && maxx < x[i].grey)
          maxx = x[i].grey;
        x[i].flag1 = 1;
        check[x[i].id] = 1;
      }
    }
  }
  cnt = 0;
  for (int i = 1; i <= p - k; i++) {
    y[i].flag2 = 0;
    check[y[i].id] = 0;
  }
  sort(y + 1, y + 1 + n, cmp3);
  for (int i = 1; i <= n; i++) {
    if (cnt == p - k) break;
    if (check[y[i].id] == 1) continue;
    if (y[i].displease < minn) {
      y[i].flag2 = 1;
      check[y[i].id] = 1;
      cnt++;
    } else if (y[i].displease == minn) {
      if (y[i].grey >= maxx) {
        y[i].flag2 = 1;
        check[y[i].id] = 1;
        cnt++;
      }
    }
  }
  int tmp;
  for (int i = 1; i <= n; i++) {
    if (check[i] == 1) {
      printf("%d", i);
      tmp = i;
      break;
    }
  }
  for (int i = tmp + 1; i <= n; i++) {
    if (check[i] == 1) printf(" %d", i);
  }
  printf("\n");
  return 0;
}
