public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = new StringTokenizer("");
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out)));

        int C = nextInt();
        int P = nextInt();
        int N = nextInt();
        int[] array = new int[C];

        for (int n = 0; n < C; n++) {
            array[n] = -1;
        }


        StringTokenizer _tokenizer = new StringTokenizer(reader.readLine());
        int index = 0;
        while (_tokenizer.hasMoreElements()) {
            int i = Integer.parseInt(_tokenizer.nextToken());
            array[index++] = i;
        }

        PriorityQueue<Course> queue = new PriorityQueue<Course>(100000, new Comparator<Course>() {
            @Override
            public int compare(Course i, Course j) {
                return i.z > j.z ? 1 : (i.z == j.z ? (i.index > j.index ? 1 : (i.index == j.index ? 0 : -1)) : -1);
            }
        });

        for (int i = 0; i < C; i++) {
            queue.add(new Course(array[i], i));
        }

        _tokenizer = new StringTokenizer(reader.readLine());
        for (int p = 0; p < P; p++) {
            int i = 0;
            if (_tokenizer.hasMoreElements()) {
                i = Integer.parseInt(_tokenizer.nextToken());
            }
            Course c = queue.poll();
            pw.print(c.index + 1);
            pw.print(" ");
            c.addIQ(i);
            queue.add(c);
        }


        reader.close();
        pw.close();
    }