#include <bits/stdc++.h>
using namespace std;
struct rec {
  int ibu, ank, pos, rank;
};
int n, p, k;
rec t[100111];
int awal = 0;
bool comp(rec a, rec b) {
  if (a.ibu != b.ibu) return a.ibu < b.ibu;
  return a.ank > b.ank;
}
bool komp(rec a, rec b) {
  if (a.ank != b.ank) return a.ank > b.ank;
  return a.rank > b.rank;
}
bool ccomp(rec a, rec b) { return a.rank < b.rank; }
vector<int> v;
int main() {
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &t[i].ank, &t[i].ibu);
    t[i].pos = i;
  }
  sort(t + 1, t + n + 1, comp);
  for (int i = 1; i <= n; i++) t[i].rank = i;
  sort(t + 1, t + n + 1, komp);
  int con = 1;
  int imin = 1000111222;
  for (int i = 1; i <= n; i++) {
    if (t[i].rank > p - k) {
      v.push_back(t[i].pos);
      con++;
      imin = min(imin, t[i].rank);
    }
    if (con > k) break;
  }
  sort(t + 1, t + n + 1, ccomp);
  for (int i = imin - (p - k); i <= imin - 1; i++) v.push_back(t[i].pos);
  for (int i = 0; i < v.size(); i++) {
    if (i > 0) putchar(' ');
    printf("%d", v[i]);
  }
  puts("");
}
