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

public class journey_md implements Runnable {
    private class Pair implements Comparable<Pair> {
        long value;
        int id;
        
        public Pair(long value, int id) {
            this.value = value;
            this.id = id;
        }

        public int compareTo(Pair that) {
            if (value < that.value) return -1;
            if (value > that.value) return 1;
            return 0;
        }
    }
    
    private BufferedReader in;
    private PrintWriter out;

    public void run() {
        try {
            solve();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private void solve() throws IOException {
        Locale.setDefault(Locale.US);
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(in.readLine());
        int n = Integer.parseInt(st.nextToken());
        int t = Integer.parseInt(st.nextToken());
        int[] w = new int[n];
        int[] d = new int[n];
        int[] p = new int[n];
        st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            w[i] = Integer.parseInt(st.nextToken());
        }
        st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            d[i] = Integer.parseInt(st.nextToken());
        }
        st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            p[i] = Integer.parseInt(st.nextToken());
        }
        
        Pair[] pigs = new Pair[n];
        Pair[] villages = new Pair[n];
        for (int i = 0; i < n; i++) {
            pigs[i] = new Pair(w[i], i);
            villages[i] = new Pair(p[i] - (long)t * d[i], i);
        }
        Arrays.sort(pigs);
        Arrays.sort(villages);
        int[] ans = new int[n];
        for (int i = 0; i < n; i++) {
            ans[villages[i].id] = pigs[i].id;
        }
        for (int i = 0; i < n; i++) {
            out.print(ans[i] + 1);
            if (i < n - 1)
                out.print(" ");
        }
        out.println();
        in.close();
        out.close();
    }

    public static void main(String[] args) {
        new Thread(new journey_md()).start();
    }
}
