import java.io.*;
import java.util.*;

public class kabaleo_va_wa implements Runnable {
	public static void main(String[] args) {
		new Thread(new kabaleo_va_wa()).run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}

		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void solve() throws IOException {
		int n = nextInt();
		int p = nextInt();
		int c = nextInt();
		int h = nextInt() - 1;

		int[] game = new int[c];
		int[] hand = new int[c];

		int[] b = new int[n];
		for (int i = 0; i < b.length; i++) {
			b[i] = nextInt() - 1;
			game[b[i]]++;
		}
		int[] pp = new int[p];
		for (int i = 0; i < pp.length; i++) {
			pp[i] = nextInt() - 1;
			hand[pp[i]]++;
		}

		if (n == 1) {
			if (pp[pp.length - 1] != h) {
				out.println(0);
			} else {
				out.println("1\n1");
			}
			return;
		}

		int max1 = -1;
		int max2 = -1;
		for (int i = 0; i < c; i++) {
			if (i == h)
				continue;
			int m = game[i] + hand[i];
			if (max1 == -1 || m > game[max1] + hand[max1]) {
				max1 = i;
			} else if (max2 == -1 || m > game[max2] + hand[max2]) {
				max2 = i;
			}
		}

		if (max2 == -1) {
			max2 = max1;
		}

		// System.err.println(max1 + " " + max2);
		//
		// System.err.println(h);
		// System.err.println(Arrays.toString(game));
		// System.err.println(Arrays.toString(hand));

		ArrayList<Integer> ans = new ArrayList<Integer>();
		game[pp[0]]++;
		for (int i = 0; i < b.length; i++) {
			game[b[i]]--;

			int rm = max1 == -1 ? 0 : Math.max(game[max1] + hand[max1],
					game[max2] + hand[max2]);
			int left = Math.max(game[h] - (pp.length - hand[h]), 1);

			// System.err.println(Arrays.toString(game));
			// System.err.println(i + " " + rm + " " + left);

			if (left > rm && left != 1) {
				ans.add(i + 1);
			}

			game[b[i]]++;
		}

		out.println(ans.size());
		for (int x : ans) {
			out.println(x);
		}
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("kabaleo.in"));
			out = new PrintWriter("kabaleo.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
