#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[100005];
int pos[100005];
bool cmp(int x, int y) {
  if (a[x].second == a[y].second) return a[x].first < a[y].first;
  return a[x].second > a[y].second;
}
class mycmp {
 public:
  bool operator()(const int x, const int y) {
    return a[pos[x]].first < a[pos[y]].first;
  }
};
multiset<int, mycmp> s;
int main(int argc, char const *argv[]) {
  int n, p, k;
  scanf("%d %d %d", &n, &p, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i].first, &a[i].second);
    pos[i] = i;
  }
  sort(pos, pos + n, cmp);
  for (int i = 0; i < k; i++) s.insert(i);
  for (int i = k; i < n - (p - k); i++) {
    if (a[pos[i]] > a[pos[*s.begin()]]) {
      s.erase(s.begin());
      s.insert(i);
    }
  }
  int mx = 0;
  for (typeof((s).begin()) it = (s).begin(); it != (s).end(); it++) {
    printf("%d ", pos[*it] + 1);
    mx = max(mx, *it);
  }
  for (int i = 1; i <= p - k; i++) printf("%d ", pos[mx + i] + 1);
  return 0;
}
