#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn], b[maxn];
vector<pair<pair<int, int>, int> > v1;
vector<pair<int, int> > v2;
int n, p, k;
int main() {
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 0; i < n; i++) scanf("%d%d", &a[i], &b[i]);
  for (int i = 0; i < n; i++)
    v1.push_back(make_pair(make_pair(b[i], -a[i]), i));
  sort(v1.begin(), v1.end());
  for (int i = p - k; i < n; i++)
    v2.push_back(make_pair(-v1[i].first.second, i));
  sort(v2.begin(), v2.end());
  reverse(v2.begin(), v2.end());
  int mn = n;
  for (int i = 0; i < k; i++) {
    printf("%d ", v1[v2[i].second].second + 1);
    mn = min(mn, v2[i].second);
  }
  for (int i = mn - 1; i >= mn - p + k; i--) printf("%d ", v1[i].second + 1);
  return 0;
}
