#include <bits/stdc++.h>
using namespace std;
const long long MOD = (1e9) + 7;
const int INF = 1e9;
const long long INF64 = 1e18;
const double EPS = 1e-12;
const double PI = acos(-1);
const long long MD = 6235164;
const long long T = 23917;
const int N = 400100;
const int M = 2010;
struct st {
  long long first, second, num, ind;
};
int n, p, k;
st a[N];
vector<int> ans;
vector<pair<long long, long long> > b;
bool mark[N];
bool comp(st a, st b) {
  return (a.second > b.second || (a.second == b.second && a.first < b.first));
}
int main() {
  cin >> n >> p >> k;
  for (int i = 0; i < int(n); i++) {
    cin >> a[i].first >> a[i].second;
    a[i].num = i + 1;
  }
  sort(a, a + n, comp);
  for (int i = 0; i < int(n); i++) a[i].ind = i;
  p -= k;
  n -= p;
  for (int i = 0; i < int(n); i++) b.push_back(make_pair(-a[i].first, i));
  sort((b).begin(), (b).end());
  long long maxi = -1;
  for (int i = 0; i < int(k); i++) {
    ans.push_back(a[b[i].second].num);
    maxi = max(maxi, b[i].second);
  }
  n += p;
  for (int i = maxi + 1; i <= maxi + p; i++) ans.push_back(a[i].num);
  for (int i = 0; i < int(int((ans).size())); i++) cout << ans[i] << ' ';
  return 0;
}
