#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, P, K;
  cin >> N >> P >> K;
  vector<pair<int, int> > orders(N);
  for (int i = 0; i < N; i++) cin >> orders[i].first >> orders[i].second;
  vector<pair<pair<int, int>, int> > basicOrders;
  for (int i = 0; i < N; i++)
    basicOrders.push_back(
        make_pair(make_pair(orders[i].second, -1 * orders[i].first), i));
  sort(basicOrders.begin(), basicOrders.end());
  vector<pair<pair<int, int>, int> > maxGreyOrders;
  for (int i = P - K; i < basicOrders.size(); i++) {
    maxGreyOrders.push_back(make_pair(
        make_pair(basicOrders[i].first.second, -1 * basicOrders[i].first.first),
        basicOrders[i].second));
  }
  sort(maxGreyOrders.begin(), maxGreyOrders.end());
  vector<int> ans;
  for (int i = 0; i < K; i++) ans.push_back(maxGreyOrders[i].second + 1);
  int minDamageValue = orders[ans[0] - 1].second;
  for (int i = 1; i < ans.size(); i++)
    minDamageValue = min(minDamageValue, orders[ans[i] - 1].second);
  vector<pair<int, int> > maxDamage;
  for (int i = 0; i < P - K; i++)
    maxDamage.push_back(
        make_pair(-1 * basicOrders[i].first.first, basicOrders[i].second));
  for (int i = K; i < maxGreyOrders.size(); i++)
    if (-1 * maxGreyOrders[i].first.second < minDamageValue)
      maxDamage.push_back(
          make_pair(maxGreyOrders[i].first.second, maxGreyOrders[i].second));
  sort(maxDamage.begin(), maxDamage.end());
  for (int i = 0; i < P - K; i++) ans.push_back(maxDamage[i].second + 1);
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
