#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair <int, int> PII;
const int MaxN=1e6+7;

int N,P,C,H;
int st[MaxN],pl[MaxN];
int cs[MaxN],cp[MaxN],cm[MaxN];
int other;
vector <int> A;

void init(){
    scanf("%d%d%d%d",&N,&P,&C,&H);
    for (int i=1; i<=N; i++){
        scanf("%d",st+i);
        cs[st[i]]++;
    }
    for (int i=1; i<=P; i++){
        scanf("%d",pl+i);
        cp[pl[i]]++;
        if (i>1 && pl[i]!=H) other++;
    }
    for (int i=1; i<=C; i++) cm[i]=cs[i]+cp[i];
}

void writeall(){
    printf("%d\n",N);
    for (int i=1; i<N; i++) printf("%d ",i);
    printf("%d\n",N);
}

void writeans(){
    printf("%d\n",(int)A.size());
    for (int i=0; i<A.size(); i++){
        printf("%d",A[i]);
        if (i+1<A.size()) printf(" ");
    }
    puts("");
}

int main(){
    freopen("kabaleo.in","r",stdin);
    freopen("kabaleo.out","w",stdout);
    init();
    if (N==1){
        if (pl[P]==H) printf("1\n1\n"); else printf("0\n\n");
        return 0;
    }
    int Hleft=cs[H]-other+(pl[1]==H);
    if (Hleft<=1){
        printf("0\n\n"); return 0;
    }

    int eq=0, ls1=0;
    for (int i=1; i<=C; i++) if (i!=H){
        if (cm[i]>Hleft){ printf("0\n\n"); return 0; }
        if (cm[i]==Hleft){
            if (eq){ printf("0\n\n"); return 0; }
            eq=i;
        }
        if (cm[i]==Hleft-1) ls1=1;
    }
    if (eq){
        for (int i=1; i<=N; i++)
            if (st[i]==eq) A.push_back(i);
        writeans(); return 0;
    }
    if (ls1){
        for (int i=1; i<=N; i++)
            if (st[i]!=H) A.push_back(i);
        writeans(); return 0;
    }
    writeall();
    return 0;
}
