#include <bits/stdc++.h>
struct Order {
  long x, y, i, j;
};
using namespace std;
int main(void) {
  long n, m, z, i = -1;
  Order O[100000], Q[100000];
  for (cin >> n >> m >> z; n ^ ++i; O[i].i = 1 + i) cin >> O[i].y >> O[i].x;
  sort(O, n + O, [](const Order& A, const Order& B) {
    return A.x > B.x || A.x == B.x && A.y < B.y;
  });
  for (memcpy(Q, O, (i = n -= m -= z) * sizeof(O[0])); i--; Q[i].j = i)
    ;
  stable_sort(Q, n + Q,
              [](const Order& A, const Order& B) { return A.y > B.y; });
  for (; z--; i = max(i, Q[z].j)) cout << Q[z].i << ' ';
  for (; m--; cout << O[++i].i << ' ')
    ;
  return 0;
}
