#include <bits/stdc++.h>
using namespace std;
int n, k, q, db, mini = INT_MAX, f;
vector<pair<pair<int, int>, int> > el, h;
vector<pair<int, int> > e;
int x[100002], y[100002];
bool v[100002], s[100002];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) {
    int a, b;
    cin >> a >> b;
    x[i] = a, y[i] = b;
    el.push_back({{b, -a}, i});
    h.push_back({{-a, -b}, i});
  }
  sort(el.begin(), el.end()), sort(h.begin(), h.end());
  for (int i = 0; i < k - q; i++) {
    v[el[i].second] = true;
  }
  for (int i = 0; db < q; i++) {
    int se = h[i].second;
    if (!v[se]) {
      s[se] = true, db++;
      if (y[se] < mini || (mini == y[se] && f < x[se])) {
        mini = y[se], f = x[se];
      }
    }
  }
  db = 0;
  for (int i = n - 1; db < k - q; i--) {
    int se = el[i].second;
    if (!s[se] && (y[se] < mini || (y[se] == mini && x[se] >= f)))
      s[se] = true, db++;
  }
  for (int i = 1; i <= n; i++)
    if (s[i]) cout << i << " ";
  return 0;
}
