#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long a[100005], b[100005], s[100005], t[100005];
bool f[100005];
bool cmp(long long x, long long y) {
  if (b[x] != b[y]) {
    return b[x] > b[y];
  } else
    return a[x] < a[y];
}
bool cc(long long x, long long y) {
  if (a[x] != a[y]) {
    return a[x] > a[y];
  } else
    return b[x] > b[y];
}
bool cd(long long x, long long y) {
  if (b[x] != b[y]) {
    return b[x] > b[y];
  } else
    return a[x] <= a[y];
}
pair<long long, long long> cur;
long long ans;
bool cm(long long x, long long y) { return b[x] > b[y]; }
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, p, k;
  cin >> n >> p >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 1; i <= n; i++) s[i] = i;
  sort(s + 1, s + n + 1, cmp);
  for (long long i = 1; i <= n - p + k; i++) t[i] = s[i];
  sort(t + 1, t + n - p + k + 1, cc);
  vector<long long> ans;
  long long maxi = t[1];
  for (long long i = 2; i <= k; i++) {
    if (cd(maxi, t[i])) maxi = t[i];
  }
  for (long long i = 1; i <= k; i++) f[t[i]] = 1;
  vector<long long> el;
  for (long long i = 1; i <= n; i++)
    if (!f[i] && cd(maxi, i)) el.push_back(i);
  sort(el.begin(), el.end(), cm);
  for (long long i = 1; i <= k; i++) {
    ans.push_back(t[i]);
  }
  for (long long i = 0; i < p - k; i++) ans.push_back(el[i]);
  sort(ans.begin(), ans.end());
  for (long long i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  cout << '\n';
  return 0;
}
