import java.io.*;
import java.util.*;

public class journey_gk {
    static class Pair<
        F extends Comparable<? super F>, 
        S extends Comparable<? super S>
    > implements Comparable<Pair<F, S>> {
        public final F first;
        public final S second;

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }

        public int compareTo(Pair<F, S> that) {
            if (this.first.compareTo(that.first) != 0) {
                return this.first.compareTo(that.first);
            } else {
                return this.second.compareTo(that.second);
            }
        }
    }

    static Scanner scanner;

    static int[] readInts(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }
        return a;
    }

    public static void main(String[] args) throws IOException {
        scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int t = scanner.nextInt();

        int[] w = readInts(n);
        int[] d = readInts(n);
        int[] p = readInts(n);

        List<Pair<Integer, Integer>> pigs = new ArrayList<Pair<Integer, Integer>>();
        for (int i = 0; i < n; i++) {
            pigs.add(new Pair<Integer, Integer>(w[i], i));
        }
        Collections.sort(pigs);

        List<Pair<Long, Integer>> towns = new ArrayList<Pair<Long, Integer>>();
        for (int i = 0; i < n; i++) {
            towns.add(new Pair<Long, Integer>(p[i] - (long)t * d[i], i));
        }
        Collections.sort(towns);

        int[] ans = new int[n];
        for (int i = 0; i < n; i++) {
            ans[towns.get(i).second] = pigs.get(i).second;
        }

        PrintWriter writer = new PrintWriter(System.out);
        for (int i = 0; i < n; i++) {
            writer.print((ans[i] + 1) + " ");
        }
        writer.close();
    }
}
