#include <bits/stdc++.h>
using namespace std;
int a[100010], b[100010];
int p[100010];
int Id[100010];
int gao[1000010];
bool cmp(int x, int y) {
  if (b[x] == b[y]) return a[x] > a[y];
  return b[x] > b[y];
}
bool cmp1(int x, int y) {
  if (b[x] == b[y]) return a[x] > a[y];
  return b[x] < b[y];
}
bool cmp2(int x, int y) {
  if (a[x] == a[y]) return b[x] > b[y];
  return a[x] > a[y];
}
int main() {
  ios::sync_with_stdio(false);
  int n, fu, k;
  cin >> n >> fu >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    p[i] = i;
  }
  sort(p, p + n, cmp1);
  for (int i = fu - k; i < n; i++) {
    Id[i - fu + k] = p[i];
  }
  for (int i = 0; i < n; i++) {
    gao[p[i]] = i;
  }
  int cao = n - 1;
  sort(Id, Id + n - (fu - k), cmp2);
  for (int i = 0; i < k; i++) {
    cout << Id[i] + 1 << " ";
    cao = min(cao, gao[Id[i]]);
  }
  for (int i = 0; i < fu - k; i++) {
    cout << p[cao - 1 - i] + 1 << " ";
  }
  cout << endl;
  return 0;
}
