#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const double eps = 1e-10;
const long long linf = 1e18 + 7;
const long long hh = 523;
pair<pair<int, int>, int> ss[100007];
int hy[100007];
pair<pair<int, int>, int> s1[100007];
vector<int> ans;
bool d1(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.first != b.first.first) {
    return a.first.first < b.first.first;
  }
  return a.first.second > b.first.second;
}
int main() {
  int n, p, k;
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &ss[i].first.second, &ss[i].first.first);
    ss[i].second = i;
  }
  sort(ss, ss + n, d1);
  for (int i = 0; i < n; i++) {
    hy[i] = ss[i].second;
    s1[i].first.first = ss[i].first.second;
    s1[i].first.second = ss[i].first.first;
    s1[i].second = i;
  }
  sort(s1 + p - k, s1 + n);
  int mn = n;
  for (int i = n - 1; i >= n - k; i--) {
    ans.push_back(s1[i].second);
    mn = min(mn, s1[i].second);
  }
  for (int i = mn - 1; i >= mn - (p - k); i--) {
    ans.push_back(i);
  }
  for (int i = 0; i <= ans.size() - 1; i++) {
    if (i != ans.size() - 1) {
      printf("%d ", hy[ans[i]] + 1);
    } else {
      printf("%d\n", hy[ans[i]] + 1);
    }
  }
  return 0;
}
