#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto i : v) os << i << " ";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  for (auto i : v) os << i << " ";
  return os;
}
struct node {
  int a, h, id;
  bool taken;
  node(int a = 0, int h = 0, int i = 0) : a(a), h(h), id(i), taken(false) {}
};
const int INF = 1e9 + 7;
const int N = 1e5 + 233;
int aid[N], hid[N], _aid[N], _hid[N], d[N];
node event[N];
int n, m, q;
int cmpa(const node i, const node j) {
  if (i.a == j.a) return i.h > j.h;
  return i.a > j.a;
}
int cmph(const node i, const node j) {
  if (i.h == j.h) return i.a > j.a;
  return i.h > j.h;
}
int cmp(const node i, const node j) {
  if (i.a == j.a) return i.h < j.h;
  return i.a > j.a;
}
void debug() {
  for (int i = 0; i < n; ++i) {
    node x = event[i];
    printf("%d %2d %2d\n", x.id, x.a, x.h);
  }
  printf("\n");
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    event[i] = node(y, x, i);
    d[i] = aid[i] = hid[i] = i;
  }
  sort(event, event + n, cmp);
  n -= (m - q);
  sort(event, event + n, cmph);
  vector<int> ans;
  vector<int>().swap(ans);
  int ma, mh;
  ma = mh = INF;
  for (int i = 0; i < q; ++i) {
    event[i].taken = true;
    ans.push_back(event[i].id + 1);
    if (ma > event[i].a) {
      ma = event[i].a;
      mh = event[i].h;
    }
  }
  n += (m - q);
  sort(event, event + n, cmpa);
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (cnt == (m - q)) break;
    node x = event[i];
    if (x.taken) continue;
    if (x.a == ma && x.h < mh) continue;
    if (ma >= x.a) {
      cnt++;
      ans.push_back(x.id + 1);
    }
  }
  cout << ans << endl;
  return 0;
}
