// Only one maximum is used
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class kabaleo_gk_wa_max1 {
    static Scanner in;
    static PrintWriter out;

    void run() {
        int n = in.nextInt();
        int p = in.nextInt();
        int c = in.nextInt();
        int h = in.nextInt() - 1;

        int[] board = new int[n];
        for (int i = 0; i < n; i++) {
            board[i] = in.nextInt() - 1;
        }

        int[] players = new int[p];
        for (int i = 0; i < p; i++) {
            players[i] = in.nextInt() - 1;
        }

        List<Integer> result = solve(c, h, board, players);
        out.println(result.size());
        for (Integer i : result) {
            out.println(i + 1);
        }
    }

    List<Integer> solve(int c, int h, int[] board, int[] players) {
        if (board.length == 1) {
            if (players[players.length - 1] == h) {
                return Arrays.asList(0);
            } else {
                return Arrays.asList();
            }
        }

        int[] boardColors = new int[c + 1];
        for (int color : board) {
            boardColors[color]++;
        }

        int[] playerColors = new int[c + 1];
        for (int color : players) {
            playerColors[color]++;
        }

        int max1 = 0;
        int maxi1 = c;
        int max2 = 0;
        int maxi2 = c;
        for (int i = 0; i < c; i++) {
            if (i != h) {
                int s = boardColors[i] + playerColors[i];
                if (max1 < s) {
                    max2 = max1;
                    maxi2 = maxi1;
                    max1 = s;
                    maxi1 = i;
                } else if (max2 < s) {
                    max2 = s;
                    maxi2 = i;
                }
            }
        }

//        assert maxi1 != c;
//        maxi1 = maxi2;
        maxi2 = maxi1;
        int minus = players.length - 1 - playerColors[h];
        List<Integer> result = new ArrayList<>();
        for (int i = 0; i < board.length; i++) {
            int color = board[i];
            boardColors[color]--;
            if (boardColors[h] - minus > Math.max(boardColors[maxi1] + playerColors[maxi1], boardColors[maxi2] + playerColors[maxi2])) {
                result.add(i);
            }
            boardColors[color]++;
        }
        return result;
    }

    public static void main(String[] args) throws Exception {
        in = new Scanner(new File("kabaleo.in"));
        out = new PrintWriter("kabaleo.out");

        new kabaleo_gk_wa_max1().run();

        in.close();
        out.close();
    }
}
