
import java.io.*;
import java.util.*;
 
public class kabaleo_keka_wa {
    private static void solve() throws IOException {
        int stacks = nextInt();
        int players = nextInt();
        int colors = nextInt();
        int ourColor = nextInt() - 1;
        int[] count = new int[colors];
        int[] stackInitialColor = new int[stacks];
        for (int i = 0; i < stacks; i++) {
            int cur = nextInt() - 1;
            stackInitialColor[i] = cur;
            ++count[cur];
        }
        int ourHand = nextInt() - 1;
        int[] playersHold = new int[colors];
        int lastPlayerPuts = ourHand;
        for (int i = 0; i < players - 1; i++) {
            int cur = nextInt() - 1;
            ++playersHold[cur];
            lastPlayerPuts = cur;
        }
 
        if (stacks == 1) {
            if (lastPlayerPuts == ourColor) {
                out.println(1);
                out.println(1);
                return;
            } else {
                out.println(0);
                out.println();
                return;
            }
        }
 
        int countEnemies = players - 1 - playersHold[ourColor];
 
        if (count[ourColor] == stacks && ourHand != ourColor) {
            --count[ourColor];
            ++count[ourHand];
            ourHand = -1;
        }
 
        if (countEnemies >= count[ourColor]) {
            out.println(0);
            out.println();
            return;
        }
 
        for (int i = 0; i < colors; i++) {
            if (i == ourColor) {
                continue;
            }
            count[ourColor] -= playersHold[i];
            count[i] += playersHold[i];
        }
 
        int max1 = -1, max2 = -1;
 
        for (int i = 0; i < colors; i++) {
            if (i == ourColor) {
                continue;
            }
            if (max1 < 0 || count[i] > count[max1]) {
                max2 = max1;
                max1 = i;
            } else {
                if (max2 < 0 || count[i] > count[max2]) {
                    max2 = i;
                }
            }
        }
 
        if (ourHand < 0) {
            if (count[ourColor] > count[max1]) {
                out.println(stacks);
                for (int i = 0; i < stacks; i++) {
                    if (i > 0) {
                        out.print(' ');
                    }
                    out.print(i + 1);
                }
                out.println();
                return;
            } else {
                out.println(0);
                out.println();
                return;
            }
        }
 
        List<Integer> moves = new ArrayList<>();
 
        for (int ourMove = 0; ourMove < stacks; ourMove++) {
            int was = stackInitialColor[ourMove];
            --count[was];
            ++count[ourHand];
 
            if (count[ourColor] > count[max1]
                    && (max2 < 0 || count[ourColor] > count[max2])) {
                moves.add(ourMove);
            }
 
            ++count[was];
            --count[ourHand];
        }
        out.println(moves.size());
        for (int i = 0; i < moves.size(); i++) {
            if (i > 0) {
                out.print(' ');
            }
            out.print(moves.get(i) + 1);
        }
        out.println();
 
    }
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new FileReader("kabaleo.in"));
        out = new PrintWriter("kabaleo.out");
        solve();
        out.close();
    }
 
    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;
 
    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }
 
    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
 
    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
}
