#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int INF = 0x3f3f3f3f;
const int iinf = 1 << 30;
const long long linf = 2e18;
const int MOD = 1000000007;
const double eps = 1e-7;
void print(int x) {
  cout << x << endl;
  exit(0);
}
void PRINT(string x) {
  cout << x << endl;
  exit(0);
}
void douout(double x) { printf("%lf\n", x + 0.0000000001); }
template <class T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void upd(T &a, T b) {
  (a += b) %= MOD;
}
template <class T>
void mul(T &a, T b) {
  a = (long long)a * b % MOD;
}
int n, p, k;
struct node {
  int a, b, id;
} a[N];
bool cmp(node a, node b) {
  if (a.b == b.b) return a.a < b.a;
  return a.b > b.b;
}
bool cmp2(node a, node b) {
  if (a.a == b.a) return a.b > b.b;
  return a.a > b.a;
}
signed main() {
  scanf("%d%d%d", &n, &p, &k);
  for (int i = (1) - 1; i <= (n)-1; i++) {
    scanf("%d%d", &a[i].a, &a[i].b);
    a[i].id = i + 1;
  }
  sort(a, a + n, cmp);
  sort(a, a + (n - (p - k)), cmp2);
  set<int> ans;
  int m = iinf;
  for (int i = (1) - 1; i <= (k)-1; i++) {
    ans.insert(a[i].id);
    m = min(m, a[i].b);
  }
  sort(a + k, a + n, cmp);
  for (int i = k; i < n && ((int)ans.size()) < p; i++)
    if (a[i].b < m || i > n - (p - k) - 1) ans.insert(a[i].id);
  for (int x : ans) printf("%d ", x);
  cout << endl;
  return 0;
}
