#include <bits/stdc++.h>
using namespace std;
struct lem {
  int m;
  int v;
  int pos;
};
int n, k, h;
lem* a = new lem[100000];
int mez[100000];
bool cmp(lem x, lem y) {
  if (x.m != y.m)
    return x.m < y.m;
  else
    return x.v < y.v;
}
double low, high;
void bs() {
  double t = (low + high) / 2;
  for (int i = 0; i < n; i++) {
    long long x = (long long)((long double)t * (long long)a[i].v);
    if (x > k) x = k;
    mez[i] = x;
  }
  int idx = k;
  for (int x = n - 1; x >= 0; x--) {
    if (mez[x] >= idx) idx--;
    if (idx == 0) break;
  }
  if (idx == 0)
    high = t;
  else
    low = t;
}
int main() {
  cin >> n >> k >> h;
  for (int i = 0; i < n; i++) {
    a[i].pos = i + 1;
    scanf("%d", &a[i].m);
  }
  for (int i = 0; i < n; i++) scanf("%d", &a[i].v);
  sort(a, a + n, cmp);
  low = 0;
  high = k + 1;
  for (int i = 0; i < 128; i++) bs();
  int ans[100000];
  for (int i = 0; i < n; i++) {
    long long x = (long long)((long double)high * (long long)a[i].v);
    if (x > k) x = k;
    mez[i] = x;
  }
  int idx = k;
  for (int x = n - 1; x >= 0; x--) {
    if (mez[x] >= idx) {
      ans[idx - 1] = a[x].pos;
      idx--;
    }
    if (idx == 0) break;
  }
  for (int i = 0; i < k; i++) printf("%d ", ans[i]);
  return 0;
}
