import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Solution for NEERC'2013 Problem K: Kabaleo Lite.
 * This solution checks correctness of the input.
 *
 * @author Roman Elizarov
 */
public class kabaleo_re_stress {

    private static final int MAX_N = 1_000_000;
    private static final int MAX_P = 1_000_000;
    private static final int MAX_C = 1_000_000;

    public static void main(String[] args) throws Exception {
        new kabaleo_re_stress().go();
    }

    void go() throws Exception {
        long time = System.currentTimeMillis();
        read();
        solve();
        write();
        System.out.printf("Done in %d ms%n", System.currentTimeMillis() - time);
    }

    int n;
    int p;
    int c;
    int h;
    int[] b;
    int[] l;

    void read() throws Exception {
        Scanner in = new Scanner(new File("kabaleo.in"));
        n = in.nextInt();
        p = in.nextInt();
        c = in.nextInt();
        h = in.nextInt();
        in.nextLine();
        assert n >= 1 && n <= MAX_N;
        assert p >= 1 && p <= MAX_P;
        assert c >= p && c <= MAX_C;
        assert h >= 1 && h <= c;
        b = new int[n];
        for (int i = 0; i < n; i++) {
            b[i] = in.nextInt();
            assert b[i] >= 1 && b[i] <= c;
        }
        in.nextLine();
        l = new int[p];
        for (int i = 0; i < p; i++) {
            l[i] = in.nextInt();
            assert l[i] >= 1 && l[i] <= c;
        }
        in.nextLine();
        in.close();
    }

    int w;
    boolean[] wf;

    public List<Integer> solve(int n, int p, int colors, int h, int[] board, int[] players) {
        this.n = n;
        this.p = p;
        this.c = colors;
        this.h = h + 1;
        this.b = new int[n];
        for (int i = 0; i < n; i++) {
            b[i] = board[i] + 1;
        }
        this.l = new int[p];
        for (int i = 0; i < p; i++) {
            l[i] = players[i] + 1;
        }

        return solve();
    }

    static class CountIndex implements Comparable<CountIndex> {
        int count;
        int index;

        CountIndex(int count, int index) {
            this.count = count;
            this.index = index;
        }

        @Override
        public int compareTo(CountIndex o) {
            return o.count - count;
        }
    }

    List<CountIndex> ci;

    List<Integer> solve() {
        wf = new boolean[n];
        if (n == 1) {
            wf[0] = l[p - 1] == h;
        } else {
            assert n > 1;
            ci = new ArrayList<>();
            // at least 3 elements in ci
            for (int i = 0; i < Math.max(c, 3); i++)
                ci.add(new CountIndex(0, i + 1));
            for (int i = 0; i < n; i++)
                ci.get(b[i] - 1).count++;
            for (int i = 1; i < p; i++)
                if (l[i] != h) {
                    ci.get(l[i] - 1).count++;
                    ci.get(h - 1).count--;
                }
            // we'll add our chip to all various place instead of something else
            ci.get(l[0] - 1).count++;
            Collections.sort(ci);
            // find our chip in order
            int hIndex = -1;
            for (int i = 0; i < ci.size(); i++)
                if (ci.get(i).index == h) {
                    hIndex = i;
                    break;
                }
            swap(ci, 0, hIndex); // place our chip @ 0
            // ci[0]   -- your hidden color
            // ci[1,2] -- top other colors (in no particular order)
            for (int i = 0; i < n; i++) {
                adj(b[i], -1);
                wf[i] = ci.get(0).count > Math.max(ci.get(1).count, ci.get(2).count);
                adj(b[i], 1);
            }
        }
        List<Integer> answer = new ArrayList<>();
        for (int i = 0; i < n; i++)
            if (wf[i])
                answer.add(i);
        return answer;
    }

    private void swap(List<CountIndex> ci, int i, int j) {
        CountIndex t = ci.get(i);
        ci.set(i, ci.get(j));
        ci.set(j, t);
    }

    private void adj(int color, int delta) {
        // only 3 colors matter (two top other and yours)
        for (int j = 0; j < 3; j++)
            if (ci.get(j).index == color)
                ci.get(j).count += delta;
    }

    void write() throws Exception {
        PrintWriter out = new PrintWriter("kabaleo.out");
        out.println(w);
        boolean first = true;
        for (int i = 0; i < n; i++) {
            if (wf[i]) {
                if (first)
                    first = false;
                else
                    out.print(" ");
                out.print(i + 1);
            }
        }
        out.close();
    }

//----------------- just for validation ------------------

    /**
     * Strict scanner to verify 100% correspondence between input files and input file format specification.
     * It is a drop-in replacement for {@link java.util.Scanner} that could be added to a solution source
     * (cut-and-paste) without breaking its ability to work with {@link java.util.Scanner}.
     */
    public class Scanner {
        private final BufferedReader in;
        private String line = "";
        private int pos;
        private int lineNo;

        public Scanner(File source) throws FileNotFoundException {
            in = new BufferedReader(new FileReader(source));
            nextLine();
        }

        public void close() {
            assert line == null : "Extra data at the end of file";
            try {
                in.close();
            } catch (IOException e) {
                throw new AssertionError("Failed to close with " + e);
            }
        }

        public void nextLine() {
            assert line != null : "EOF";
            assert pos == line.length() : "Extra characters on line " + lineNo;
            try {
                line = in.readLine();
            } catch (IOException e) {
                throw new AssertionError("Failed to read line with " + e);
            }
            pos = 0;
            lineNo++;
        }

        public String next() {
            assert line != null : "EOF";
            assert line.length() > 0 : "Empty line " + lineNo;
            if (pos == 0)
                assert line.charAt(0) > ' ' : "Line " + lineNo + " starts with whitespace";
            else {
                assert pos < line.length() : "Line " + lineNo + " is over";
                assert line.charAt(pos) == ' ' : "Wrong whitespace on line " + lineNo;
                pos++;
                assert pos < line.length() : "Line " + lineNo + " is over";
                assert line.charAt(pos) > ' ' : "Line " + lineNo + " has double whitespace";
            }
            StringBuilder sb = new StringBuilder();
            while (pos < line.length() && line.charAt(pos) > ' ')
                sb.append(line.charAt(pos++));
            return sb.toString();
        }

        public int nextInt() {
            String s = next();
            assert s.length() == 1 || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
            assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
            try {
                return Integer.parseInt(s);
            } catch (NumberFormatException e) {
                throw new AssertionError("Malformed number " + s + " on line " + lineNo);
            }
        }
    }
}
