
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.*;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.InputStream;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class kabaleo_petr_stress {
    public static void main(String[] args) {
        InputStream inputStream;
        try {
            inputStream = new FileInputStream("kabaleo.in");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        OutputStream outputStream;
        try {
            outputStream = new FileOutputStream("kabaleo.out");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        InputReader_stress in = new InputReader_stress(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Kabaleo_stress solver = new Kabaleo_stress();
        solver.solve(1, in, out);
        out.close();
    }
}
 
class Kabaleo_stress {
    public void solve(int testNumber, InputReader_stress in, PrintWriter out) {
        int n = in.nextInt();
        int p = in.nextInt();
        int c = in.nextInt();
        int h = in.nextInt() - 1;
        int[] b = new int[n];
        for (int i = 0; i < n; ++i) b[i] = in.nextInt() - 1;
        int[] l = new int[p];
        for (int i = 0; i < p; ++i) l[i] = in.nextInt() - 1;
        List<Integer> answer = solve(n, p, c, h, b, l);
        out.println(answer.size());
        for (Integer integer : answer) {
            out.println(integer + 1);
        }
    }

    List<Integer> solve(int n, int p, int c, int h, int[] b, int[] l) {
        if (n == 1) {
            if (l[p - 1] == h) {
                return Collections.singletonList(0);
            } else {
                return Collections.emptyList();
            }
        }
        int[] bcnt = new int[c];
        for (int x : b) ++bcnt[x];
        boolean[] wins = new boolean[n];
        int[] willadd = new int[c];
        for (int i = 1; i < p; ++i) {
            if (l[i] != h) {
                ++bcnt[l[i]];
                --bcnt[h];
            }
        }
        int maxother = 0;
        int maxothercol = -1;
        int maxother2 = 0;
        int maxother2col = -1;
        for (int i = 0; i < c; ++i) if (i != h) {
            if (bcnt[i] > maxother) {
                maxother2 = maxother;
                maxother2col = maxothercol;
                maxother = bcnt[i];
                maxothercol = i;
            } else if (bcnt[i] > maxother2) {
                maxother2 = bcnt[i];
                maxother2col = i;
            }
        }
        if (h == l[0]) {
            if (bcnt[h] > maxother) {
                Arrays.fill(wins, true);
            } else if (bcnt[h] == maxother) {
                for (int i = 0; i < n; ++i) if (b[i] != h) {
                    wins[i] = true;
                }
            } else if (bcnt[h] == maxother - 1 && maxother2 < maxother) {
                for (int i = 0; i < n; ++i) if (b[i] == maxothercol) {
                    wins[i] = true;
                }
            }
        } else {
            if (bcnt[h] >= maxother + 3) {
                Arrays.fill(wins, true);
            } else if (bcnt[h] == maxother + 2) {
                if (bcnt[l[0]] == maxother) {
                    for (int i = 0; i < n; ++i) if (b[i] != h) {
                        wins[i] = true;
                    }
                } else {
                    Arrays.fill(wins, true);
                }
            } else if (bcnt[h] == maxother + 1) {
                if (bcnt[l[0]] == maxother) {
                    for (int i = 0; i < n; ++i) if (b[i] == l[0]) {
                        wins[i] = true;
                    }
                } else {
                    for (int i = 0; i < n; ++i) if (b[i] != h) {
                        wins[i] = true;
                    }
                }
            } else if (bcnt[h] == maxother) {
                if (maxother2 < maxother && bcnt[l[0]] < maxother - 1) {
                    for (int i = 0; i < n; ++i) if (b[i] == maxothercol) {
                        wins[i] = true;
                    }
                }
            }
        }
        List<Integer> result = new ArrayList<>();
        for (int i = 0; i < wins.length; i++) {
            if (wins[i]) {
                result.add(i);
            }
        }
        return result;
    }
}
 
class InputReader_stress {
    public BufferedReader reader;
    public StringTokenizer tokenizer;
 
    public InputReader_stress(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
 
    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
 
    public int nextInt() {
        return Integer.parseInt(next());
    }
 
    }