#include<bits/stdc++.h>
#define mx 4100
#define endl "\n"
using namespace std;
int dp[mx][105];
int freq[mx];
main(){
//	freopen("input.txt","r",stdin);
	int n,m,q;
	cin>>n>>m>>q;
	int arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	//reverse(arr,arr+n);
	for(int i=0;i<m;i++){
		int mask = 0;
		string str;
		cin>>str;
		int count = 0;
		for(int j=n-1;j>=0;j--){
			mask += (str[j]-'0')*pow(2,count++);
		}
		freq[mask]++;
	}
	for(int i=0;i<mx;i++){
		for(int j=0;j<mx;j++){
			int sum = 0;
			int p = i^j;
			for (int k = 0; k < n; ++k)
			{
				if(!(p & (1<<k))){
					sum += arr[n-k-1];
				}
			}
			if(sum <= 100){
				dp[i][sum] += freq[j];
			}
		}
	}
	for(int i=0;i<mx;i++){
		for(int j=1;j<=100;j++){
			dp[i][j] += dp[i][j-1];
		}
	}
	while(q--){
		string str;
		cin>>str;
		int num;
		cin>>num;
		int mask = 0;
		int count = 0;
		for(int j=n-1;j>=0;j--){
			mask += (str[j]-'0')*pow(2,count++);
		}
		cout<<dp[mask][num]<<endl;

	}

}


#include<bits/stdc++.h>
#define mx 4100
using namespace std;
int dp[mx][105];
int freq[mx];
main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//	freopen("input.txt","r",stdin);
	int n,m,q;
	cin>>n>>m>>q;
	int arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	//reverse(arr,arr+n);
	for(int i=0;i<m;i++){
		int mask = 0;
		string str;
		cin>>str;
		int count = 0;
		for(int j=n-1;j>=0;j--){
			mask += (str[j]-'0')*pow(2,count++);
		}
		freq[mask]++;
	}
	for(int i=0;i<mx;i++){
		for(int j=0;j<mx;j++){
			int p = i^j;
			int sum = 0;
			for (int k = 0; k < n; ++k)
			{
				if(!(p & (1<<k))){
					sum += arr[n-k-1];
				}
			}
			if(sum <= 100){
				dp[i][sum] += freq[j];
			}
		}
	}
	for(int i=0;i<mx;i++){
		for(int j=1;j<=100;j++){
			dp[i][j] += dp[i][j-1];
		}
	}
	while(q--){
		string str;
		cin>>str;
		int num;
		cin>>num;
		int mask = 0;
		int count = 0;
		for(int j=n-1;j>=0;j--){
			mask += (str[j]-'0')*pow(2,count++);
		}
		cout<<dp[mask][num]<<endl;
	}

}


#include<bits/stdc++.h>
//#define ll int
#define ll long long
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define yn idehfushefuwheuf
#define y1 issdehfushefuwheuf
#define endL "\n"
#define all(a) a.begin(),a.end()
#define p_b push_back
#define pll pair<ll,ll>
#define vout(a); {cout<<a;return 0;}
#define sqr(a) ((a)*(a))

const ll gig = 1e18;
const ll gg = 25*1e6;
const ll mod = 1e9 + 7;

using namespace std;

vector<ll> s1, s2;
ll w[33];
ll a, p;
char c;
ll mp[4444];
ll zf[4444][111];
ll pr[4444][111];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

//    freopen("1.out", "r", stdin);
//    freopen("1.out", "w", stdout);
    ll n, m, q;

    cin >> n >> m >> q;

    for (int i = 0; i < n; i++) cin >> w[i];

//    cout << "!" << endl;

    ll p = (1 << (n - 1));

    for (int i = 0; i < m; i++) {
        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        mp[a]++;
    }

//    cout << "!" << endl;

    ll o = 1 << n;
    o--;
    for (int i = 0; i <= o; i++) {
        s1.clear();
        a = i;
        while (a != 0) {
            if (a % 2 == 1) s1.p_b(1); else s1.p_b(0);
            a /= 2;
        }

        while (s1.size() != n ) s1.p_b(0);
        reverse(all(s1));

        for (int j = 0; j <= o; j++) if (mp[j] != 0) {
            s2.clear();
            a = j;
            while (a != 0) {
                if (a % 2 == 1) s2.p_b(1); else s2.p_b(0);
                a /= 2;
            }
            while (s2.size() != n ) s2.p_b(0);
            reverse(all(s2));

//            cout << i << " " << j << endl;

            ll b = 0;
            for (int q = 0; q < n; q++) if (s1[q] == s2[q]) b += w[q];
            if (b > 100) continue;
            zf[i][b] += mp[j];
//            cout << i << " " << b << " " << mp[j] << "__" <<  endl;
        }

//        cout << "!" << endl;
        pr[i][0] = zf[i][0] ;
        for (int j = 1; j <= 100; j++) pr[i][j] = pr[i][j - 1] += zf[i][j];
    }

//    cout <<

    for (int i = 1; i <= q; i++) {

        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        ll b;
        cin >> b;
//        cout << a << " " << pr[a][100] << endl;
        cout << pr[a][b] << endL;
    }

}


#include<bits/stdc++.h>
//#define ll int
#define ll long long
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define yn idehfushefuwheuf
#define y1 issdehfushefuwheuf
#define endL "\n"
#define all(a) a.begin(),a.end()
#define p_b push_back
#define pll pair<ll,ll>
#define vout(a); {cout<<a;return 0;}
#define sqr(a) ((a)*(a))

const ll gig = 1e18;
const ll gg = 25*1e6;
const ll mod = 1e9 + 7;

using namespace std;

vector<ll> s1, s2;
ll w[33];
ll a, p;
char c;
ll mp[4444];
ll zf[4444][111];
ll pr[4444][111];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

//    freopen("1.out", "r", stdin);
//    freopen("1.out", "w", stdout);
    ll n, m, q;

    cin >> n >> m >> q;

    for (int i = 0; i < n; i++) cin >> w[i];

//    cout << "!" << endl;

    ll p = (1 << (n - 1));

    for (int i = 0; i < m; i++) {
        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        mp[a]++;
    }

//    cout << "!" << endl;

    ll o = 1 << n;
    o--;
    for (int i = 0; i <= o; i++) {
        s1.clear();
        a = i;
        while (a != 0) {
            if (a % 2 == 1) s1.p_b(1); else s1.p_b(0);
            a /= 2;
        }

        while (s1.size() != n ) s1.p_b(0);
        reverse(all(s1));

        for (int j = 0; j <= o; j++) if (mp[i] != 0) {
            s2.clear();
            a = j;
            while (a != 0) {
                if (a % 2 == 1) s2.p_b(1); else s2.p_b(0);
                a /= 2;
            }
            while (s2.size() != n ) s2.p_b(0);
            reverse(all(s2));

//            cout << i << " " << j << endl;

            ll b = 0;
            for (int q = 0; q < n; q++) if (s1[q] == s2[q]) b += w[q];
            if (b > 100) continue;
            zf[i][b] += mp[j];
//            cout << i << " " << b << " " << mp[j] << "__" <<  endl;
        }

//        cout << "!" << endl;
        pr[i][0] = zf[i][0] ;
        for (int j = 1; j <= 100; j++) pr[i][j] = pr[i][j - 1] += zf[i][j];
    }

//    cout <<

    for (int i = 1; i <= q; i++) {

        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        ll b;
        cin >> b;
//        cout << a << " " << pr[a][100] << endl;
        cout << pr[a][b] << endL;
    }

}


 #include<bits/stdc++.h>
//#define ll int
#define ll long long
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define yn idehfushefuwheuf
#define y1 issdehfushefuwheuf
#define endL "\n"
#define all(a) a.begin(),a.end()
#define p_b push_back
#define pll pair<ll,ll>
#define vout(a); {cout<<a;return 0;}
#define sqr(a) ((a)*(a))

const ll gig = 1e18;
const ll gg = 25*1e6;
const ll mod = 1e9 + 7;

using namespace std;

string s;
ll w[111];
map<string, ll> mp;
ll pr[4444][111], f[4444][111], a, k[4444], b;
string bt[4444];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

//    freopen("1.out", "r", stdin);
//    freopen("1.out", "w", stdout);

    ll n, m, q;

    cin >> n >> m >> q;

    for (int i = 0; i < n; i++) cin >> w[i];

    ll o = 1 << n; o--;
    for (int i = 0; i <= o; i++) {
        a = i;
        s = "";
        while(a != 0) {
            if (a % 2) s += '1'; else s += '0';
            a /= 2;
        }
        while (s.size() != n) {
            s += '0';
//            cout << s.size() << endl;
        }
        reverse(all(s));
//        cout << s << endl;

        mp[s] = i;
        bt[i] = s;
    }

    for (int i = 1; i <= m; i++) {
        cin >> s;
        k[mp[s]] ++;
    }

    for (int i = 0; i <= o; i++) {

        for (int j = 0; j <= o; j++) if (k[j] != 0) {
            b = 0;
            for (int q = 0; q < n; q++) if (bt[i][q] == bt[j][q]) b += w[q];
//            cout << i << " ++ " << j <<  " " << b << endl;
            if (b > 100) continue;
            f[i][b] += k[j];
//            cout << i << " " << j << " " << b << endl;
        }
        pr[i][0] = f[i][0];
        for (int j = 1; j <= 100; j++) pr[i][j] = pr[i][j - 1] + f[i][j];
    }

    for (int i = 0; i < q; i++) {
        cin >> s >> b;
        a = mp[s];
        cout << pr[a][b] << endL;
//        cout << a << " " << pr[a][100] << endl;
    }

}


#include<bits/stdc++.h>
//#define ll int
#define ll long long
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define yn idehfushefuwheuf
#define y1 issdehfushefuwheuf
#define endL "\n"
#define all(a) a.begin(),a.end()
#define p_b push_back
#define pll pair<ll,ll>
#define vout(a); {cout<<a;return 0;}
#define sqr(a) ((a)*(a))

const ll gig = 1e18;
const ll gg = 25*1e6;
const ll mod = 1e9 + 7;

using namespace std;

vector<ll> s1, s2;
ll w[33];
ll a, p;
char c;
ll mp[4444];
ll zf[4444][111];
ll pr[4444][111];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

//    freopen("1.out", "r", stdin);
//    freopen("1.out", "w", stdout);
    ll n, m, q;

    cin >> n >> m >> q;

    for (int i = 0; i < n; i++) cin >> w[i];

//    cout << "!" << endl;

    ll p = (1 << (n - 1));

    for (int i = 0; i < m; i++) {
        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        mp[a]++;
    }

//    cout << "!" << endl;

    ll o = 1 << n;
    o--;
    for (int i = 0; i <= o; i++) {
        s1.clear();
        a = i;
        while (a != 0) {
            if (a % 2 == 1) s1.p_b(1); else s1.p_b(0);
            a /= 2;
        }

        while (s1.size() != n ) s1.p_b(0);
        reverse(all(s1));

        for (int j = 0; j <= o; j++) {
            s2.clear();
            a = j;
            while (a != 0) {
                if (a % 2 == 1) s2.p_b(1); else s2.p_b(0);
                a /= 2;
            }
            while (s2.size() != n ) s2.p_b(0);
            reverse(all(s2));

//            cout << i << " " << j << endl;

            ll b = 0;
            for (int q = 0; q < n; q++) if (s1[q] == s2[q]) b += w[q];

            zf[i][b] += mp[j];
//            cout << i << " " << b << " " << mp[j] << "__" <<  endl;
        }

//        cout << "!" << endl;
        pr[i][0] = zf[i][0] ;
        for (int j = 1; j <= 100; j++) pr[i][j] = pr[i][j - 1] += zf[i][j];
    }

//    cout <<

    for (int i = 1; i <= q; i++) {

        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        ll b;
        cin >> b;
//        cout << a << " " << pr[a][100] << endl;
        cout << pr[a][b] << endL;
    }

}


#include<bits/stdc++.h>
//#define ll int
#define ll long long
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define yn idehfushefuwheuf
#define y1 issdehfushefuwheuf
#define endL "\n"
#define all(a) a.begin(),a.end()
#define p_b push_back
#define pll pair<ll,ll>
#define vout(a); {cout<<a;return 0;}
#define sqr(a) ((a)*(a))

const ll gig = 1e18;
const ll gg = 25*1e6;
const ll mod = 1e9 + 7;

using namespace std;

vector<ll> s1, s2, z[4444];
ll w[33];
ll a, p;
char c;
ll mp[4444];
ll zf[4444][111];
ll pr[4444][111];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

//    freopen("1.out", "r", stdin);
//    freopen("1.out", "w", stdout);
    ll n, m, q;

    cin >> n >> m >> q;

    for (int i = 0; i < n; i++) cin >> w[i];

//    cout << "!" << endl;

    ll p = (1 << (n - 1));

    for (int i = 0; i < m; i++) {
        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        mp[a]++;
    }

//    cout << "!" << endl;

    ll o = 1 << n;
    o--;

    for (int i = 0; i <= o; i++) {
        s1.clear();
        a = i;
        while (a != 0) {
            if (a % 2 == 1) s1.p_b(1); else s1.p_b(0);
            a /= 2;
        }
        while (s1.size() != n ) s1.p_b(0);
        reverse(all(s1));

        z[a] = s1;
    }

    for (int i = 0; i <= o; i++) {
       s1 = z[i];

        for (int j = 0; j <= o; j++) if (mp[j] != 0) {
            s2 = z[j];

//            cout << i << " " << j << endl;

            ll b = 0;
            for (int q = 0; q < n; q++) if (s1[q] == s2[q]) b += w[q];
            if (b > 100) continue;
            zf[i][b] += mp[j];
//            cout << i << " " << b << " " << mp[j] << "__" <<  endl;
        }

//        cout << "!" << endl;
        pr[i][0] = zf[i][0] ;
        for (int j = 1; j <= 100; j++) pr[i][j] = pr[i][j - 1] += zf[i][j];
    }

//    cout <<

    for (int i = 1; i <= q; i++) {

        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        ll b;
        cin >> b;
//        cout << a << " " << pr[a][100] << endl;
        cout << pr[a][b] << endL;
    }

}


#include<bits/stdc++.h>
//#define ll int
#define ll long long
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define yn idehfushefuwheuf
#define y1 issdehfushefuwheuf
#define endL "\n"
#define all(a) a.begin(),a.end()
#define p_b push_back
#define pll pair<ll,ll>
#define vout(a); {cout<<a;return 0;}
#define sqr(a) ((a)*(a))

const ll gig = 1e18;
const ll gg = 25*1e6;
const ll mod = 1e9 + 7;

using namespace std;

vector<ll> s1, s2, z[4444];
ll w[33];
ll a, p;
char c;
ll mp[4444];
ll zf[4444][111];
ll pr[4444][111];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

//    freopen("1.out", "r", stdin);
//    freopen("1.out", "w", stdout);
    ll n, m, q;

    cin >> n >> m >> q;

    for (int i = 0; i < n; i++) cin >> w[i];

//    cout << "!" << endl;

    ll p = (1 << (n - 1));

    for (int i = 0; i < m; i++) {
        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        mp[a]++;
    }

//    cout << "!" << endl;

    ll o = 1 << n;
    o--;

    for (int i = 0; i <= o; i++) {
        s1.clear();
        a = i;
        while (a != 0) {
            if (a % 2 == 1) s1.p_b(1); else s1.p_b(0);
            a /= 2;
        }
        while (s1.size() != n ) s1.p_b(0);
        reverse(all(s1));

        z[i] = s1;
    }

    for (int i = 0; i <= o; i++) {
       s1 = z[i];

        for (int j = 0; j <= o; j++) if (mp[j] != 0) {
            s2 = z[j];

//            cout << i << " " << j << endl;

            ll b = 0;
            for (int q = 0; q < n; q++) if (s1[q] == s2[q]) b += w[q];
            if (b > 100) continue;
            zf[i][b] += mp[j];
//            cout << i << " " << b << " " << mp[j] << "__" <<  endl;
        }

//        cout << "!" << endl;
        pr[i][0] = zf[i][0] ;
        for (int j = 1; j <= 100; j++) pr[i][j] = pr[i][j - 1] += zf[i][j];
    }

//    cout <<

    for (int i = 1; i <= q; i++) {

        p = (1 << (n - 1));
        a = 0;
        for (int j = 0; j < n; j++) {
            cin >> c;
            if (c == '1') a += p;
            p /= 2;
        }
        ll b;
        cin >> b;
//        cout << a << " " << pr[a][100] << endl;
        cout << pr[a][b] << endL;
    }

}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <stack>
#include <complex>
#include <unordered_set>
using namespace std;

typedef long double C;
typedef complex<C> P;

#define X real()
#define Y imag()
#define ll long long
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
#define int long long

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);
	int m, k, n, s; cin >> m >> k >> n >> s;
	vector<int> a(m), b(s);
	for (int i = 0; i < m; i++)
		cin >> a[i];
	for (int i = 0; i < s; i++)
		cin >> b[i];
	set<int> colors;
	int c = 0;
	for (int i = 0; i < s; i++) {
		if (colors.find(b[i]) == colors.end()) {
			c++;
			colors.insert(b[i]);
		}
	}
	int cl = 0;
	vector<int> ctr(1e6), obr(1e6);
	for (int i = 0; i < s; i++)
		obr[b[i]]++;
	for (int l = 0, r = 0; r < m; r++)
	{
		if (ctr[a[r]] + 1 == obr[a[r]] && colors.find(a[r]) != colors.end())
			cl++;
		ctr[a[r]]++;

		while (l <= r && c == cl)
		{
			int left = (m - l - ((r - l + 1) - k)) / k, right = n - min((n - 1), l / k);
			if ((m - l - ((r - l + 1) - k)) / k >= n - min((n - 1), l / k)) {
				int ans = l - min((n - 1), l / k) * k;
				ans += (r - l + 1) - k;
				cout << ans << endl;
				for (int i = 0; i < l - min((n - 1), l / k) * k; i++)
					cout << i + 1 << " ";
				int leng = r - l + 1;
				vector<int> cntr(1e6);
				for (int i = l; i <= r && leng > k; i++) {
					cntr[a[i]]++;
					if (colors.find(a[i]) == colors.end()) {
						cout << i + 1 << " ";
						leng--;
					}
					else if (cntr[a[i]] > obr[a[i]]) {
						cout << i + 1 << " ";
						leng--;
					}
				}
				return 0;
			}
			if (ctr[a[l]] == obr[a[l]] && colors.find(a[l]) != colors.end())
				cl--;
			ctr[a[l]]--;
			l++;
		}
	}
	cout << -1;
	return 0;
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <string>
#define int long long
#define ui unsigned int
#define mp make_pair
using namespace std;

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);
	int m, k, n, s; cin>>m>>k>>n>>s;
	vector<int> a(m), b(s);
	for(int i = 0; i < m; i++)
		cin>>a[i];
	for(int i = 0; i < s; i++)
		cin>>b[i];
set<int> colors;
int c = 0;
for(int i = 0; i < s; i++){
if(colors.find(b[i])==colors.end()){
	c++;
	colors.insert(b[i]);
}
}

int cl = 0;
vector<int> ctr(1e6), obr(1e6);
for(int i = 0; i < s; i++)
obr[b[i]]++;
int ans = 1e9, left, right;
for(int l = -1, r = 0; r < m; r++)
{
	if(ctr[a[r]] + 1 == obr[a[r]] && colors.find(a[r]) != colors.end())
	cl++;
	ctr[a[r]]++;
	while(l < r && c == cl)
	{
		int leng = r - l + 1;
		if(leng>= k){
			int nans = leng - k;
			nans += l % k;
			if((m - nans) / k >= n){
				ans = nans;
				left = l;
				right = r;
			}
		}
		if(ctr[a[l]] == obr[a[l]] && colors.find(a[l]) != colors.end())
		cl--;
		ctr[a[l]]--;
		l++;
	}
}
if(ans == 1e9)
cout<<-1;
else{
	cout<<ans<<endl;
	int pred = left, leng = right - left + 1;

	for(int i = 0; i < left && pred % k != 0; pred--, i++){
	cout<<i+1<<" ";
	}
	vector<int> cntr(1e6);
	for(int i = left; i < right && leng > k; i++){
		cntr[a[i]]++;
		if(colors.find(a[i])==colors.end()){
		cout<<i+1<<" ";
		leng--;
		}
		else if(cntr[a[i]] > obr[a[i]]){
		cout<<i+1<<" ";
		leng--;
		}
	}
}
	return 0;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <stack>
#include <complex>
#include <unordered_set>
using namespace std;

typedef long double C;
typedef complex<C> P;

#define X real()
#define Y imag()
#define ll long long
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
#define int long long

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);
	int m, k, n, s; cin >> m >> k >> n >> s;
	vector<int> a(m), b(s);
	for (int i = 0; i < m; i++)
		cin >> a[i];
	for (int i = 0; i < s; i++)
		cin >> b[i];
	set<int> colors;
	int c = 0;
	for (int i = 0; i < s; i++) {
		if (colors.find(b[i]) == colors.end()) {
			c++;
			colors.insert(b[i]);
		}
	}

	int cl = 0;
	vector<int> ctr(1e6), obr(1e6);
	for (int i = 0; i < s; i++)
		obr[b[i]]++;
	int ans = 1e9, left, right;
	for (int l = 0, r = 0; r < m; r++)
	{
		if (ctr[a[r]] + 1 == obr[a[r]] && colors.find(a[r]) != colors.end())
			cl++;
		ctr[a[r]]++;

		while (l < r && c == cl)
		{
			int leng = r - l + 1;
			if (leng >= k) {
				int nans = leng - k;
				nans += l % k;
				if ((m - nans) / k >= n && l / k >= n - 1) {
					ans = nans;
					left = l;
					right = r;
				}
			}
			if (ctr[a[l]] == obr[a[l]] && colors.find(a[l]) != colors.end())
				cl--;
			ctr[a[l]]--;
			l++;
		}
		int leng = r - l + 1;
		if (leng >= k) {
			int nans = leng - k;
			nans += l % k;
			if ((m - nans) / k >= n && l / k >= n - 1) {
				ans = nans;
				left = l;
				right = r;
			}
		}
	}
	if (ans == 1e9)
		cout << -1;
	else {
		cout << ans << endl;
		int pred = left, leng = right - left + 1;

		for (int i = 0; i < left && pred % k != 0; pred--, i++) {
			cout << i + 1 << " ";
		}
		vector<int> cntr(1e6);
		for (int i = left; i < right && leng > k; i++) {
			cntr[a[i]]++;
			if (colors.find(a[i]) == colors.end()) {
				cout << i + 1 << " ";
				leng--;
			}
			else if (cntr[a[i]] > obr[a[i]]) {
				cout << i + 1 << " ";
				leng--;
			}
		}
	}
	return 0;
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <string>
#define int long long
#define ui unsigned int
#define mp make_pair
using namespace std;

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);
	int m, k, n, s; cin>>m>>k>>n>>s;
	vector<int> a(m), b(s);
	for(int i = 0; i < m; i++)
		cin>>a[i];
	for(int i = 0; i < s; i++)
		cin>>b[i];
set<int> colors;
int c = 0;
for(int i = 0; i < s; i++){
if(colors.find(b[i])==colors.end()){
	c++;
	colors.insert(b[i]);
}
}

int cl = 0;
vector<int> ctr(1e6), obr(1e6);
for(int i = 0; i < s; i++)
obr[b[i]]++;
int ans = 1e9, left, right;
for(int l = -1, r = 0; r < m; r++)
{
	if(ctr[a[r]] + 1 == obr[a[r]] && colors.find(a[r]) != colors.end())
	cl++;
	ctr[a[r]]++;
	while(l < r && c == cl)
	{
		int leng = r - l + 1;
		if(leng>= k){
			int nans = leng - k;
			nans += l % k;
			if((m - nans) / k >= n && l / k >= n - 1){
				ans = nans;
				left = l;
				right = r;
			}
		}
		if(ctr[a[l]] == obr[a[l]] && colors.find(a[l]) != colors.end())
		cl--;
		ctr[a[l]]--;
		l++;
	}
}
if(ans == 1e9)
cout<<-1;
else{
	cout<<ans<<endl;
	int pred = left, leng = right - left + 1;

	for(int i = 0; i < left && pred % k != 0; pred--, i++){
	cout<<i+1<<" ";
	}
	vector<int> cntr(1e6);
	for(int i = left; i < right && leng > k; i++){
		cntr[a[i]]++;
		if(colors.find(a[i])==colors.end()){
		cout<<i+1<<" ";
		leng--;
		}
		else if(cntr[a[i]] > obr[a[i]]){
		cout<<i+1<<" ";
		leng--;
		}
	}
}
	return 0;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <stack>
#include <complex>
#include <unordered_set>
using namespace std;

typedef long double C;
typedef complex<C> P;

#define X real()
#define Y imag()
#define ll long long
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
#define int long long

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);
	int m, k, n, s; cin >> m >> k >> n >> s;
	vector<int> a(m), b(s);
	for (int i = 0; i < m; i++)
		cin >> a[i];
	for (int i = 0; i < s; i++)
		cin >> b[i];
	set<int> colors;
	int c = 0;
	for (int i = 0; i < s; i++) {
		if (colors.find(b[i]) == colors.end()) {
			c++;
			colors.insert(b[i]);
		}
	}
	int cl = 0;
	vector<int> ctr(1e6), obr(1e6);
	for (int i = 0; i < s; i++)
		obr[b[i]]++;
	for (int l = 0, r = 0; r < m; r++)
	{
		if (ctr[a[r]] + 1 == obr[a[r]] && colors.find(a[r]) != colors.end())
			cl++;
		ctr[a[r]]++;

		while (l <= r && c == cl && r - l + 1 >= k)
		{
			if ((m - l - ((r - l + 1) - k)) / k >= n - min((n - 1), l / k)) {
				int ans = l - min((n - 1), l / k) * k;
				ans += r - l + 1 - k;
				cout << ans << endl;
				for (int i = 0; i < l - min((n - 1), l / k) * k; i++)
					cout << i + 1 << " ";
				int leng = r - l + 1;
				vector<int> cntr(1e6);
				for (int i = l; i <= r && leng > k; i++) {
					cntr[a[i]]++;
					if (colors.find(a[i]) == colors.end()) {
						cout << i + 1 << " ";
						leng--;
					}
					else if (cntr[a[i]] > obr[a[i]]) {
						cout << i + 1 << " ";
						leng--;
					}
				}
				return 0;
			}
			if (ctr[a[l]] == obr[a[l]] && colors.find(a[l]) != colors.end())
				cl--;
			ctr[a[l]]--;
			l++;
		}
	}
	cout << -1;
	return 0;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <stack>
#include <complex>
#include <unordered_set>
using namespace std;

typedef long double C;
typedef complex<C> P;

#define X real()
#define Y imag()
#define ll long long
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
#define int long long

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);
	int m, k, n, s; cin >> m >> k >> n >> s;
	vector<int> a(m), b(s);
	for (int i = 0; i < m; i++)
		cin >> a[i];
	for (int i = 0; i < s; i++)
		cin >> b[i];
	set<int> colors;
	int c = 0;
	for (int i = 0; i < s; i++) {
		if (colors.find(b[i]) == colors.end()) {
			c++;
			colors.insert(b[i]);
		}
	}

	int cl = 0;
	vector<int> ctr(1e6), obr(1e6);
	for (int i = 0; i < s; i++)
		obr[b[i]]++;
	int ans = 1e9, left, right;
	for (int l = 0, r = 0; r < m; r++)
	{
		if (ctr[a[r]] + 1 == obr[a[r]] && colors.find(a[r]) != colors.end())
			cl++;
		ctr[a[r]]++;

		while (l < r && c == cl)
		{
			int leng = r - l + 1;
			if (leng >= k) {
				int nans = leng - k;
				nans += l % k;
				if ((m - nans) / k >= n && l / k >= n - 1) {
					ans = nans;
					left = l;
					right = r;
				}
			}
			if (ctr[a[l]] == obr[a[l]] && colors.find(a[l]) != colors.end())
				cl--;
			ctr[a[l]]--;
			l++;
		}
		if(c == cl)
		{
			int leng = r - l + 1;
			if (leng >= k) {
				int nans = leng - k;
				nans += l % k;
				if ((m - nans) / k >= n && l / k >= n - 1) {
					ans = nans;
					left = l;
					right = r;
				}
			}
		}
	}
	if (ans == 1e9)
		cout << -1;
	else {
		cout << ans << endl;
		int pred = left, leng = right - left + 1;

		for (int i = 0; i < left && pred % k != 0; pred--, i++) {
			cout << i + 1 << " ";
		}
		vector<int> cntr(1e6);
		for (int i = left; i < right && leng > k; i++) {
			cntr[a[i]]++;
			if (colors.find(a[i]) == colors.end()) {
				cout << i + 1 << " ";
				leng--;
			}
			else if (cntr[a[i]] > obr[a[i]]) {
				cout << i + 1 << " ";
				leng--;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <random>
#include <climits>
#include <iomanip>
#include <queue>
#include <bitset>
#include <cctype>
#include <ostream>
#include <functional>
using namespace std;

#define forn(i,n) for (int i = 0;i < int(n);i++)
#define ford(i,n) for (int i = n-1;i >=0;i--)
#define fore(i,l,r) for (int i = int(l);i < int(r);i++)
#define correct(x,n) (((x) >= 0) && ((x) < n))
#define mp(a,b) make_pair((a),(b))
#define all(a) (a).begin(),(a).end()
#define rnd() (rand() + (RAND_MAX+1)*rand())
//#define DEBUG_

#define x first
#define y second

typedef long long li;
typedef vector<int> vi;
typedef vector<li> vli;
typedef pair<int, int> pi;
typedef pair<li, li> pli;
typedef vector<pi> vpi;
typedef vector<pli> vpli;
typedef vector<vi> vvi;
typedef vector<vli> vvli;
typedef long double ld;
typedef pair<li, li> Point;

const ld EPS = 1e-9;

int main()
{
	//freopen("in.txt", "r", stdin);
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n,k,m,s;
	cin >> n >> k >> m >> s;
	vi a(n);

	forn(i, n)
		cin >> a[i];

	vi b(5000010, 0);
	vi b1(5000010, 0);
	forn(i, s)
	{
		int val;
		cin >> val;
		b[val]++;
		b1[val]++;
	}
	int d = n - k*m;
	int num = s;
	int l = 0, r = -1;
	forn(i, m)
	{
		int l1 = k*i, r1 = k*(i + 1) + d - 1;
		while (r < r1)
		{
			b[a[r + 1]]--;
			if (b[a[r + 1]] >= 0)
				num--;
			r++;
		}
		while (l < l1)
		{
			b[a[l]]++;
			if (b[a[l]] > 0)
				num++;
			l++;
		}
		if (num == 0)
		{
			cout << d << endl;
			for (int pos = l1; pos <= r1; pos++)
				if (b1[a[pos]] > 0)
					b1[a[pos]]--;
				else if (d > 0)
				{
					cout << pos + 1 << endl;
					d--;
				}
			return 0;
		}
	}
	cout << -1 << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <random>
#include <climits>
#include <iomanip>
#include <queue>
#include <bitset>
#include <cctype>
#include <ostream>
#include <functional>
using namespace std;

#define forn(i,n) for (int i = 0;i < int(n);i++)
#define ford(i,n) for (int i = n-1;i >=0;i--)
#define fore(i,l,r) for (int i = int(l);i < int(r);i++)
#define correct(x,n) (((x) >= 0) && ((x) < n))
#define mp(a,b) make_pair((a),(b))
#define all(a) (a).begin(),(a).end()
#define rnd() (rand() + (RAND_MAX+1)*rand())
//#define DEBUG_

#define x first
#define y second

typedef long long li;
typedef vector<int> vi;
typedef vector<li> vli;
typedef pair<int, int> pi;
typedef pair<li, li> pli;
typedef vector<pi> vpi;
typedef vector<pli> vpli;
typedef vector<vi> vvi;
typedef vector<vli> vvli;
typedef long double ld;
typedef pair<li, li> Point;

const ld EPS = 1e-9;

int main()
{
	//freopen("in.txt", "r", stdin);
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n,k,m,s;
	cin >> n >> k >> m >> s;
	vi a(n);

	forn(i, n)
		cin >> a[i];

	vi b(5000010, 0);
	forn(i, s)
	{
		int val;
		cin >> val;
		b[val]++;
	}
	int d = n - k*m;
	int num = s;
	int l = 0, r = -1;
	multiset<int> st;
	forn(i, m)
	{
		int l1 = k*i, r1 = k*(i + 1) + d;
		while (r < r1)
		{
			b[a[r + 1]]--;
			if (b[a[r + 1]] >= 0)
				num--;
			else
				st.insert(r + 1);
			r++;
		}
		while (l < l1)
		{
			b[a[l]]++;
			if (b[a[l]] > 0)
				num++;
			else
				st.erase(st.find(l));
			l++;
		}
		if (num == 0)
		{
			cout << st.size() << endl;
			for (auto i : st)
				cout << i+1 << endl;
			return 0;
		}
	}
	cout << -1 << endl;
}


#include<bits/stdc++.h>
using namespace std;

int m,k,n,s,val;

int a[510000],sq[510000],last[510000],fix[510000],need;
vector<int>occ[510000];
bool vis[510000];
int maxrem;
void gotit(int l,int r)
{
    vector<int>v;
    for(int i=l;i<=r;i++)
    {
        if(sq[a[i]]<=0) v.push_back(i);
        sq[a[i]]--;
    }
    cout<<min(maxrem,(int)v.size())<<endl;
    for(int i=0;i<min(maxrem,(int)v.size());i++) cout<<v[i]<<" ";
    exit(0);
}
int main()
{
    cin>>m>>k>>n>>s;

    for(int i=1; i<=m; i++) cin>>a[i];
    for(int i=1; i<=s; i++)
    {
        cin>>val;
        sq[val]++;
        need += !vis[val];
        vis[val] = 1;
    }
    maxrem = m - n*k;
    set<pair<int,int> >s;
    for(int i=1; i<=m; i++)
    {
        occ[a[i]].push_back(i);

        while(occ[a[i]].size() - last[a[i]] > sq[a[i]]) last[a[i]]++;
        if(sq[a[i]] && occ[a[i]].size() - last[a[i]] == sq[a[i]])
        {
            int del = occ[a[i]][last[a[i]]];

            if(fix[a[i]])s.erase(make_pair(fix[a[i]],a[i]));
            s.insert(make_pair(del,a[i]));
            fix[a[i]] = del;
        }

        if(s.size() == need )
        {
            int cur = s.begin() -> first;
            int range  = i - cur + 1;
            int deln = range - k;
            if(deln<=maxrem)
            {
                gotit(cur,i);
            }
        }
    }

    cout<<-1<<endl;

}


#include<bits/stdc++.h>
using namespace std;

int m,k,n,s,val;

int a[510000],sq[510000],last[510000],fix[510000],need;
vector<int>occ[510000];
bool vis[510000];
int maxrem;
void gotit(int l,int r)
{
    vector<int>v;
    for(int i=l;i<=r;i++)
    {
        if(sq[a[i]]<=0) v.push_back(i);
        sq[a[i]]--;
    }
    cout<<min(maxrem,(int)v.size())<<endl;
    for(int i=0;i<min(maxrem,(int)v.size());i++) cout<<v[i]<<" ";
    cout<<endl;
    exit(0);
}
int main()
{
    cin>>m>>k>>n>>s;

    for(int i=1; i<=m; i++) cin>>a[i];
    for(int i=1; i<=s; i++)
    {
        cin>>val;
        sq[val]++;
        need += !vis[val];
        vis[val] = 1;
    }
    maxrem = m - n*k;
    set<pair<int,int> >s;
    for(int i=1; i<=m; i++)
    {
        occ[a[i]].push_back(i);

        while(occ[a[i]].size() - last[a[i]] > sq[a[i]]) last[a[i]]++;
        if(sq[a[i]] && occ[a[i]].size() - last[a[i]] == sq[a[i]])
        {
            int del = occ[a[i]][last[a[i]]];

            if(fix[a[i]])s.erase(make_pair(fix[a[i]],a[i]));
            s.insert(make_pair(del,a[i]));
            fix[a[i]] = del;
        }

        if(s.size() == need )
        {
            int cur = s.begin() -> first;
            int range  = i - cur + 1 + (cur-1)%k;
            int deln = range - k;
            if(deln<=maxrem)  gotit(i-range+1,i);
        }
    }

    cout<<-1<<endl;

}


#include<bits/stdc++.h>
using namespace std;

int m,k,n,s,val;

int a[510000],sq[510000],last[510000],fix[510000],need;
vector<int>occ[510000];
bool vis[510000];
int maxrem;
void gotit(int l,int r)
{
    vector<int>v;
    for(int i=l;i<=r;i++)
    {
        if(sq[a[i]]<=0) v.push_back(i);
        sq[a[i]]--;
    }
    cout<<min(maxrem,(int)v.size())<<endl;
    for(int i=0;i<min(maxrem,(int)v.size());i++) cout<<v[i]<<" ";
    exit(0);
}
int main()
{
    cin>>m>>k>>n>>s;

    for(int i=1; i<=m; i++) cin>>a[i];
    for(int i=1; i<=s; i++)
    {
        cin>>val;
        sq[val]++;
        need += !vis[val];
        vis[val] = 1;
    }
    maxrem = m - n*k;
    set<pair<int,int> >s;
    for(int i=1; i<=m; i++)
    {
        occ[a[i]].push_back(i);

        while(occ[a[i]].size() - last[a[i]] > sq[a[i]]) last[a[i]]++;
        if(sq[a[i]] && occ[a[i]].size() - last[a[i]] == sq[a[i]])
        {
            int del = occ[a[i]][last[a[i]]] - 1;

            if(fix[a[i]])s.erase(make_pair(fix[a[i]],a[i]));
            s.insert(make_pair(del,a[i]));
            fix[a[i]] = del;
        }

        if(s.size() == need )
        {
            int cur = s.begin() -> first;
            int range  = i - cur;
            int deln = range - k;
            if(deln<=maxrem)
            {
                gotit(cur+1,i);
            }
        }
    }

    cout<<-1<<endl;

}


//keep trying :)
#include <bits/stdc++.h>
#define float long double
#define int long long
#define ll long long
#define PB push_back
#define MP make_pair
#define ss second
#define ff first
#define PI 3.1415926535897932384
#define inf 9*(1e18)
#define fastrack ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
const int M = 5e5 + 7, mod = 1e9 + 7;

int ck[M], ok[M], a[M], h[M];

signed main(){
    fastrack;
    //int tt; cin >> tt; while(tt--)
    {
        int m, k, n, s;
        cin >> m >> k >> n >> s;
        for(int i = 1; i <= m; ++i)
            cin >> a[i];
        int cnt = 0;
        for(int i = 1; i <= s; ++i){
            int x;
            cin >> x;
            if(!ck[x])
                ++cnt;
            ck[x] = 1;
            ++h[x];
        }
        int ind = m;
        set <int> st;
        int num[m + 5] = {};
        for(int i = m; i >= 1; --i){
            if(ck[a[i]]){
                ++ok[a[i]];
                if(ok[a[i]] == h[a[i]])
                    st.insert(a[i]);
            }
            while(ind > i){
                if(ck[a[ind]] && ok[a[ind]] > h[a[ind]]){
                    --ok[a[ind]];
                    --ind;
                }
                else if(!ck[a[ind]]){
                    --ind;
                }
                else
                    break;
            }
            if(st.size() != cnt)
                num[i] = -1;
            else
                num[i] = ind;
        }
        for(int i = 1; i <= m; i++){
            if(num[i] != -1 && num[i] - i + 1 < k){
                if(i + k - 1 > m)
                    num[i] = -1;
                else
                    num[i] = i + k - 1;
            }
        }
        for(int i = 1; i <= m; i++){
            if(num[i] == -1 || (i - 1)%k != 0)
                continue;
            int x = (i - 1)/k + (m - num[i])/k + 1;
            if(x < n)
                continue;
            int c = (num[i] - i + 1) - k, d = 0;
            vector <int> v;
            for(int j = i; j <= num[i] && c > 0; j++){
                if(!ck[a[j]] || d == cnt){
                    v.PB(j);
                    --c;
                }
                else
                    d--;
            }
            cout << v.size() << "\n";
            for(auto u : v)
                cout << u << " ";
            return 0;
        }
        cout << -1 << "\n";
    }
    return 0;
}


//keep trying :)
#include <bits/stdc++.h>
#define float long double
#define int long long
#define ll long long
#define PB push_back
#define MP make_pair
#define ss second
#define ff first
#define PI 3.1415926535897932384
#define inf 9*(1e18)
#define fastrack ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
const int M = 5e5 + 7, mod = 1e9 + 7;

int ck[M], ok[M], a[M], h[M];

signed main(){
    fastrack;
    //int tt; cin >> tt; while(tt--)
    {
        int m, k, n, s;
        cin >> m >> k >> n >> s;
        for(int i = 1; i <= m; ++i)
            cin >> a[i];
        int cnt = 0;
        for(int i = 1; i <= s; ++i){
            int x;
            cin >> x;
            if(!ck[x])
                ++cnt;
            ck[x] = 1;
            ++h[x];
        }
        int ind = m;
        set <int> st;
        int num[m + 5] = {};
        for(int i = m; i >= 1; --i){
            if(ck[a[i]]){
                ++ok[a[i]];
                if(ok[a[i]] == h[a[i]])
                    st.insert(a[i]);
            }
            while(ind > i){
                if(ck[a[ind]] && ok[a[ind]] > h[a[ind]]){
                    --ok[a[ind]];
                    --ind;
                }
                else if(!ck[a[ind]]){
                    --ind;
                }
                else
                    break;
            }
            if(st.size() != cnt)
                num[i] = -1;
            else
                num[i] = ind;
        }
        for(int i = 1; i <= m; i++){
            if(num[i] != -1 && num[i] - i + 1 < k){
                if(i + k - 1 > m)
                    num[i] = -1;
                else
                    num[i] = i + k - 1;
            }
        }
        for(int i = 1; i <= m; i++){
            if(num[i] == -1 || (i - 1)%k != 0)
                continue;
            int x = (i - 1)/k + (m - num[i])/k + 1;
            if(x < n)
                continue;
            int c = (num[i] - i + 1) - k;
            vector <int> v;
            for(int j = i; j <= num[i] && c > 0; j++){
                if(!ck[a[j]] || !h[a[j]]){
                    v.PB(j);
                    --c;
                }
                else
                    --h[a[j]];
            }
            cout << v.size() << "\n";
            for(auto u : v)
                cout << u << " ";
            return 0;
        }
        cout << -1 << "\n";
    }
    return 0;
}


//keep trying :)
#include <bits/stdc++.h>
#define float long double
#define int long long
#define ll long long
#define PB push_back
#define MP make_pair
#define ss second
#define ff first
#define PI 3.1415926535897932384
#define inf 9*(1e18)
#define fastrack ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
const int M = 5e5 + 7, mod = 1e9 + 7;

int ck[M], ok[M], a[M], h[M];

signed main(){
    fastrack;
    //int tt; cin >> tt; while(tt--)
    {
        int m, k, n, s;
        cin >> m >> k >> n >> s;
        for(int i = 1; i <= m; ++i)
            cin >> a[i];
        int cnt = 0;
        for(int i = 1; i <= s; ++i){
            int x;
            cin >> x;
            if(!ck[x])
                ++cnt;
            ck[x] = 1;
            ++h[x];
        }
        int ind = m;
        set <int> st;
        int num[m + 5] = {};
        for(int i = m; i >= 1; --i){
            if(ck[a[i]]){
                ++ok[a[i]];
                if(ok[a[i]] == h[a[i]])
                    st.insert(a[i]);
            }
            while(ind > i){
                if(ck[a[ind]] && ok[a[ind]] > h[a[ind]]){
                    --ok[a[ind]];
                    --ind;
                }
                else if(!ck[a[ind]]){
                    --ind;
                }
                else
                    break;
            }
            if(st.size() != cnt)
                num[i] = -1;
            else
                num[i] = ind;
        }
        for(int i = 1; i <= m; i++){
            if(num[i] != -1 && num[i] - i + 1 < k){
                if(i + k - 1 > m)
                    num[i] = -1;
                else
                    num[i] = i + k - 1;
            }
        }
        for(int i = 1; i <= m; i++){
            if(num[i] == -1 || (i - 1)%k != 0)
                continue;
            int x = (i - 1)/k + (m - num[i])/k + 1;
            if(x < n)
                continue;
            int c = (num[i] - i + 1) - k, d = 0;
            vector <int> v;
            for(int j = i; j <= num[i] && c > 0; j++){
                if(!ck[a[j]] || d == cnt){
                    v.PB(j);
                    --c;
                }
                else
                    d++;
            }
            cout << v.size() << "\n";
            for(auto u : v)
                cout << u << " ";
            return 0;
        }
        cout << -1 << "\n";
    }
    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;

#define              MAX             500005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              OUT(x)          printf("%d\n",x)
#define              OUTS(x)         printf("%d ",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/*

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }*/
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int m,k,n,s;vector<int>v;vector<int>v3;vector<pii>v2;int f[MAX],fr[MAX],arr[MAX],flag[MAX],pr[MAX],pkk[MAX];vector<pii>v4;

void trace(int cnt)
{
    ///cout<<"elements from v4"<<endl;
    for(int i = 0;i<v4.size();i++)
    {
        ///cout<<v4[i].ff<<" "<<v4[i].ss<<endl;;
        if(fr[v4[i].ff]!=f[v4[i].ff])
        {
            fr[v4[i].ff]++;
        }
        else if(cnt)
        {
            cnt--;
            pr[i] = 1;
        }
    }
    ///cout<<endl;
    for(int i = 0;i<v4.size();i++)if(pr[i]==0)v3.pb(v4[i].ss);
}

void print()
{
    int res = 0;
    for(int i = 0;i<v3.size();i++)
    {
        if(v3[i]>0)
        {
            flag[v3[i]] = 1;
            res++;
        }
    }
    cout<<m - res<<endl;
    for(int i = 1;i<=m;i++)if(flag[i]==0)cout<<i<<" ";
}

void Debug()
{
    cout<<"elements from v"<<endl;for(auto it : v)cout<<it<<" ";cout<<endl;
    cout<<"elements from v2"<<endl;for(auto it : v2)cout<<it.ff<<" "<<it.ss<<endl;cout<<endl;
}

int main()
{
    booster()
    ///read("input.txt");

    cin>>m>>k>>n>>s;
    for(int i = 1;i<=m;i++)cin>>arr[i];
    for(int i = 1;i<=s;i++)
    {
        int a;
        cin>>a;
        f[a]++;
        if(f[a]==1)v.pb(a);
    }

    for(int i = 1;i<=m;i++)
    {
        if(f[arr[i]])v2.pb(pii(arr[i],i));
    }

   /// Debug();

    int len = v2.size();
    set<int>pk;
    int l = 0;
    for(int i = 0;i<len;i++)
    {
        pkk[v2[i].ff]++;
        if(pkk[v2[i].ff]==f[v2[i].ff])pk.insert(v2[i].ff);
        ///cout<<"pk size"<<endl<<pk.size()<<endl;
        if(pk.size()==v.size())
        {
            while(l<i)
            {
                if(pkk[v2[l].ff]>f[v2[l].ff])
                {
                    pkk[v2[l].ff]--;
                    l++;
                }
                else break;
            }
            int diff = v2[i].ss - v2[l].ss + 1;
            int x = (v2[l].ss - 1)%k;
            int y = (v2[l].ss - 1)/k;
            int z = (m - v2[i].ss )%k;
            int w = (m - v2[i].ss )/k;
            ///cout<<" jkjkjk "<<v2[l].ss<<" "<<v2[i].ss<<" "<<diff<<" diff "<<x<<" x "<<y<<" y "<<z<<" z "<<w<<" w"<<endl;
           /// cout<<x+z+diff<<endl<<y+w+1<<endl;
            if(x+z+diff>=k&&y+w+1>=n)
            {
                for(int j = 1;j<=y*k;j++)v3.pb(j);
                for(int j = m;j>=m-w*k+1;j--)v3.pb(j);
                int gr = v3.size()/k;
                int jr = gr - (n-1);
                if(jr)
                {
                    for(int j = 0;j<jr*k;j++)v3[j] = 0;
                }
                int pr = x+z+diff - k;
                for(int j = y*k+1;j<=y*k+x;j++)v4.pb(pii(arr[j],j));
                for(int j = m - w*k;j>=m-w*k+1-z;j--)v4.pb(pii(arr[j],j));
                for(int j = v2[l].ss;j<=v2[i].ss;j++)v4.pb(pii(arr[j],j));
                trace(pr);
                print();
                return 0;
            }
            pkk[v2[l].ff]--;
            if(pkk[v2[l].ff]<f[v2[l].ff])pk.erase(pk.find(v2[l].ff));
            l++;

        }

    }
    cout<<-1;

    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;

#define              MAX             500005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              OUT(x)          printf("%d\n",x)
#define              OUTS(x)         printf("%d ",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/*

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }*/
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int m,k,n,s;vector<int>v;vector<int>v3;vector<pii>v2;int f[MAX],fr[MAX],arr[MAX],flag[MAX],pr[MAX],pkk[MAX];vector<pii>v4;

void trace(int cnt)
{
    ///cout<<"elements from v4"<<endl;
    for(int i = 0;i<v4.size();i++)
    {
        ///cout<<v4[i].ff<<" "<<v4[i].ss<<endl;;
        if(fr[v4[i].ff]!=f[v4[i].ff])
        {
            fr[v4[i].ff]++;
        }
        else if(cnt)
        {
            cnt--;
            pr[i] = 1;
        }
    }
    ///cout<<endl;
    for(int i = 0;i<v4.size();i++)if(pr[i]==0)v3.pb(v4[i].ss);
}

void print()
{
    int res = 0;
    for(int i = 0;i<v3.size();i++)
    {
        if(v3[i]>0)
        {
            flag[v3[i]] = 1;
            res++;
        }
    }
    cout<<m - res<<endl;
    for(int i = 1;i<=m;i++)if(flag[i]==0)cout<<i<<" ";
}

void Debug()
{
    cout<<"elements from v"<<endl;for(auto it : v)cout<<it<<" ";cout<<endl;
    cout<<"elements from v2"<<endl;for(auto it : v2)cout<<it.ff<<" "<<it.ss<<endl;cout<<endl;
}

int main()
{
    booster()
    ///read("input.txt");

    cin>>m>>k>>n>>s;
    for(int i = 1;i<=m;i++)cin>>arr[i];
    for(int i = 1;i<=s;i++)
    {
        int a;
        cin>>a;
        f[a]++;
        if(f[a]==1)v.pb(a);
    }

    for(int i = 1;i<=m;i++)
    {
        if(f[arr[i]])v2.pb(pii(arr[i],i));
    }

   /// Debug();

    int len = v2.size();
    set<int>pk;
    int l = 0;
    for(int i = 0;i<len;i++)
    {
        pkk[v2[i].ff]++;
        if(pkk[v2[i].ff]==f[v2[i].ff])pk.insert(v2[i].ff);
        ///cout<<"pk size"<<endl<<pk.size()<<endl;
        if(pk.size()==v.size())
        {
            int diff = v2[i].ss - v2[l].ss + 1;
            int x = (v2[l].ss - 1)%k;
            int y = (v2[l].ss - 1)/k;
            int z = (m - v2[i].ss )%k;
            int w = (m - v2[i].ss )/k;
            ///cout<<" jkjkjk "<<v2[l].ss<<" "<<v2[i].ss<<" "<<diff<<" diff "<<x<<" x "<<y<<" y "<<z<<" z "<<w<<" w"<<endl;
           /// cout<<x+z+diff<<endl<<y+w+1<<endl;
            if(x+z+diff>=k&&y+w+1>=n)
            {
                for(int j = 1;j<=y*k;j++)v3.pb(j);
                for(int j = m;j>=m-w*k+1;j--)v3.pb(j);
                int gr = v3.size()/k;
                int jr = gr - (n-1);
                if(jr)
                {
                    for(int j = 0;j<jr*k;j++)v3[j] = 0;
                }
                int pr = x+z+diff - k;
                for(int j = y*k+1;j<=y*k+x;j++)v4.pb(pii(arr[j],j));
                for(int j = m - w*k;j>=m-w*k+1-z;j--)v4.pb(pii(arr[j],j));
                for(int j = v2[l].ss;j<=v2[i].ss;j++)v4.pb(pii(arr[j],j));
                trace(pr);
                print();
                return 0;
            }
            pkk[v2[l].ff]--;
            if(pkk[v2[l].ff]<f[v2[l].ff])pk.erase(pk.find(v2[l].ff));
            l++;

        }

    }
    cout<<-1;

    return 0;
}


#include<bits/stdc++.h>

#define hell 						 1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define sz(x)                        (ll)x.size()
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;

#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                         '\n'

#define PI 3.14159265358979323846
#define MAX 500005
#define LG 22
using namespace std;

ll m,k,n,s;
ll f2[MAX];
ll a[MAX],b[MAX];

// bool check() {
// 	for(auto it:m2) {
// 		if(it.S>mm[it.F]) return false;
// 	}
// 	return true;
// }

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    cin >> m >> k >> n >> s;
    rep(i,0,m) cin >> a[i];
    ll x=0;
    rep(i,0,s) {
    	cin >> b[i];
    	f2[b[i]]++;
    	if(f2[b[i]]==1) x++;
    }

    ll del=m-n*k;
    ll nk=k+del;

    for(ll i=0;i<m;i+=k) {
    	//i to i+nk-1
    	ll f1[MAX];
    	ll c=0;
    	rep(j,i,min(i+nk,m)) {
    		f1[a[j]]++;
    		if(f1[a[j]]==f2[a[j]]) c++;
    	}
    	if(c==x) {
    		cout << del << endl;
    		rep(j,i,min(i+nk,m)) {
    			if(del>0 && f1[a[j]]>f2[a[j]]) {
     				cout << j+1 << " ";
     				del--;
     				f1[a[j]]--;
     	 		}
    		}
    		return 0;
    	}
    }
    ret(-1);
}


#include<bits/stdc++.h>

#define hell 						 1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define sz(x)                        (ll)x.size()
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;

#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                         '\n'

#define PI 3.14159265358979323846
#define MAX 500005
#define LG 22
using namespace std;

ll m,k,n,s;
ll f2[MAX];
ll a[MAX],b[MAX];

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    cin >> m >> k >> n >> s;
    rep(i,0,m) cin >> a[i];
    ll x=0;
    rep(i,0,s) {
    	cin >> b[i];
    	f2[b[i]]++;
    	if(f2[b[i]]==1) x++;
    }

    ll del=m-n*k;
    ll nk=k+del;
    //ret(nk);

    for(ll i=0;i<m;i+=k) {
    	//i to i+nk-1
    	ll f1[MAX]={0};
    	ll c=0;
    	rep(j,i,min(i+nk,m)) {
    		f1[a[j]]++;
    		if(f1[a[j]]==f2[a[j]]) c++;
    	}

    	if(c==x) {
    		cout << del << endl;
    		rep(j,i,min(i+nk,m)) {
    			if(del>0 && f1[a[j]]>f2[a[j]]) {
     				cout << j+1 << " ";
     				del--;
     				f1[a[j]]--;
     	 		}
    		}
    		return 0;
    	}
    }
    ret(-1);
}


#include<bits/stdc++.h>

#define hell 						 1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define sz(x)                        (ll)x.size()
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;

#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                         '\n'

#define PI 3.14159265358979323846
#define MAX 500005
#define LG 22
using namespace std;

ll m,k,n,s;
map<ll,ll> mm,m2;
ll a[MAX],b[MAX];

bool check() {
	for(auto it:m2) {
		if(it.S>mm[it.F]) return false;
	}
	return true;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    cin >> m >> k >> n >> s;
    rep(i,0,m) cin >> a[i];
    rep(i,0,s) {
    	cin >> b[i];
    	m2[b[i]]++;
    }

    ll del=m-n*k;
    ll nk=k+del;

    for(ll i=0;i<m;i+=k) {
    	//i to i+nk-1
    	mm.clear();
    	rep(j,i,min(i+nk,m)) {
    		mm[a[j]]++;
    	}
    	if(check()) {
    		cout << del << endl;
    		rep(j,i,min(i+nk,m)) {
    			if(del>0 && mm[a[j]]>m2[a[j]]) {
     				cout << j+1 << " ";
     				del--;
     				mm[a[j]]--;
     	 		}
    		}
    		return 0;
    	}
    }
    ret(-1);
}


#include<bits/stdc++.h>

#define hell 						 1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define sz(x)                        (ll)x.size()
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;

#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                         '\n'

#define PI 3.14159265358979323846
#define MAX 500005
#define LG 22
using namespace std;

ll m,k,n,s;
unordered_map<ll,ll> mm,m2;
ll a[MAX],b[MAX];

bool check() {
	for(auto it:m2) {
		if(it.S>mm[it.F]) return false;
	}
	return true;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    cin >> m >> k >> n >> s;
    rep(i,0,m) cin >> a[i];
    rep(i,0,s) {
    	cin >> b[i];
    	m2[b[i]]++;
    }

    ll del=m-n*k;
    ll nk=k+del;

    for(ll i=0;i<m;i+=k) {
    	//i to i+nk-1
    	mm.clear();
    	rep(j,i,min(i+nk,m)) {
    		mm[a[j]]++;
    	}
    	if(check()) {
    		cout << del << endl;
    		rep(j,i,min(i+nk,m)) {
    			if(del>0 && mm[a[j]]>m2[a[j]]) {
     				cout << j+1 << " ";
     				del--;
     				mm[a[j]]--;
     	 		}
    		}
    		return 0;
    	}
    }
    ret(-1);
}


#include<bits/stdc++.h>

#define hell 						 1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define sz(x)                        (ll)x.size()
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;

#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                         '\n'

#define PI 3.14159265358979323846
#define MAX 500005
#define LG 22
using namespace std;

ll m,k,n,s;
map<ll,ll> m2;
ll a[MAX],b[MAX];

// bool check() {
// 	for(auto it:m2) {
// 		if(it.S>mm[it.F]) return false;
// 	}
// 	return true;
// }

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    cin >> m >> k >> n >> s;
    rep(i,0,m) cin >> a[i];
    rep(i,0,s) {
    	cin >> b[i];
    	m2[b[i]]++;
    }
    ll x=m2.size();

    ll del=m-n*k;
    ll nk=k+del;

    for(ll i=0;i<m;i+=k) {
    	//i to i+nk-1
    	map<ll,ll> mm;
    	ll c=0;
    	rep(j,i,min(i+nk,m)) {
    		mm[a[j]]++;
    		if(mm[a[j]]==m2[a[j]]) c++;
    	}
    	if(c==x) {
    		cout << del << endl;
    		rep(j,i,min(i+nk,m)) {
    			if(del>0 && mm[a[j]]>m2[a[j]]) {
     				cout << j+1 << " ";
     				del--;
     				mm[a[j]]--;
     	 		}
    		}
    		return 0;
    	}
    }
    ret(-1);
}


#include <bits/stdc++.h>

#define IOS ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mmset(arr, n) memset(arr, n, sizeof arr)
#define deci(n) cout<<fixed<<setprecision(n);
#define F first
#define S second
#define mk make_pair
#define pb push_back
#define ALPHA 27
#define ll long long int
#define ld long double
#define len(s) (int)s.length()
#define all(a) a.begin(), a.end()

using namespace std;

const ll INF = (ll)(8e18);
const ll MOD = 1e9 + 7;

const int maxn = 500010;

int m,k,n,s;
int a[maxn], b[maxn];
vector < pair <int, int> > v,t;
vector <int> ans, tpp;
set <int> q;
map <int, int> mp, tp;

bool find(int x){
    int l = 0, r = (int)tpp.size() - 1;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(tpp[mid] > x){
            r = mid - 1;
        }else if(tpp[mid] < x) l = mid + 1;
        else return true;
    }
    return false;
}
void Empty(){
    t.clear();
    q.clear();
    tp.clear();
}

bool Possible(int h){
    Empty();
    assert(q.empty() == true);
    for(auto i : tpp){
        q.insert(i);
    }
    for(int i = 1; i <= h; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
    }
    if(q.empty()){
        t.pb(mk(1, h));
    }
    for(int i = h + 1; i <= m; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
        if(find(a[i - h])){
            tp[a[i - h]]--;
            if(tp[a[i - h]] < mp[a[i - h]] && q.find(a[i - h]) == q.end()){
                q.insert(a[i - h]);
            }
        }
        if(q.empty()){
            t.pb(mk(i - h + 1, i));
        }
    }
    return t.empty() == false;
}

bool check(){
    for(auto i : v){
         int req = i.S - i.F + 1 - k;
         req += (i.F - 1) % k;
         if(req <= m - k * n){
             for(int j = 1; j <= (i.F - 1) % k; j++){
                 ans.pb(j);
             }
             req -= (i.F - 1) % k;
             for(int j = i.F; j <= i.S; j++){
                 if(req == 0) break;
                 if(mp[a[j]] == 0){
                    ans.pb(j);
                    req--;
                 }
             }
             return false;
         }
    }
    return true;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++) cin >> a[i];
    for(int i = 1; i <= s; i++){
        cin >> b[i];
        mp[b[i]]++;
        tpp.pb(b[i]);
    }
    sort(all(tpp));
    tpp.erase(unique(all(tpp)), tpp.end());
    int l = k, r = m;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(Possible(mid)){
            v = t;
            r = mid - 1;
        }else l = mid + 1;
    }
    if(v.empty() || check()){
        cout << -1 << '\n';
        return 0;
    }
    cout << (int)ans.size() << '\n';
    for(int i : ans) cout << i << ' ';
    cout << '\n';
    #ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}


#include <bits/stdc++.h>

#define IOS ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mmset(arr, n) memset(arr, n, sizeof arr)
#define deci(n) cout<<fixed<<setprecision(n);
#define F first
#define S second
#define mk make_pair
#define pb push_back
#define ALPHA 27
#define ll long long int
#define ld long double
#define len(s) (int)s.length()
#define all(a) a.begin(), a.end()

using namespace std;

const ll INF = (ll)(8e18);
const ll MOD = 1e9 + 7;

const int maxn = 500010;

int m,k,n,s;
int a[maxn], b[maxn];
vector < pair <int, int> > v,t;
vector <int> ans;
set <int> q;
map <int, int> mp, tp;

bool Possible(int h){
    t.clear();
    q.clear();
    tp.clear();
    assert(q.empty() == true);
    for(auto i : mp){
        if(i.S > 0) q.insert(i.F);
    }
    //cerr << q.size() << ' ' << tp.size() << ' ' << t.size() << ' ' << "eewewe " << mp.size() <<  '\n';
    for(int i = 1; i <= h; i++){
        if(mp[a[i]] > 0){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
    }
    if(q.empty()){
        t.pb(mk(1, h));
    }
    for(int i = h + 1; i <= m; i++){
        if(mp[a[i]] > 0){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
        if(mp[a[i - h]] > 0){
            tp[a[i - h]]--;
            if(tp[a[i - h]] < mp[a[i - h]] && q.find(a[i - h]) == q.end()){
                q.insert(a[i - h]);
            }
        }
        if(q.empty()){
            t.pb(mk(i - h + 1, i));
        }
    }
    return t.empty() == false;
}

bool check(){
    for(auto i : v){
         int req = i.S - i.F + 1 - k;
         req += (i.F - 1) % k;
         if(req <= m - k * n){
             for(int j = 1; j <= (i.F - 1) % k; j++){
                 ans.pb(j);
             }
             req -= (i.F - 1) % k;
             for(int j = i.F; j <= i.S; j++){
                 if(req == 0) break;
                 if(mp[a[j]] == 0){
                    ans.pb(j);
                    req--;
                 }
             }
             return false;
         }
    }
    return true;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++) cin >> a[i];
    for(int i = 1; i <= s; i++){
        cin >> b[i];
        mp[b[i]]++;
    }
    int l = k, r = m / n;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(Possible(mid)){
            //cerr << mid << '\n';
            v = t;
            r = mid - 1;
        }else l = mid + 1;
        //cerr << mid << ' ' << t.size() << '\n';
    }
    //  cerr << v.size() << '\n';
    //  cerr << v[0].F << ' ' << v[0].S << '\n';
    if(v.empty() || check()){
        cout << -1 << '\n';
        return 0;
    }
    cout << (int)ans.size() << '\n';
    for(int i : ans) cout << i << ' ';
    cout << '\n';
    #ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}


#include <bits/stdc++.h>

#define IOS ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mmset(arr, n) memset(arr, n, sizeof arr)
#define deci(n) cout<<fixed<<setprecision(n);
#define F first
#define S second
#define mk make_pair
#define pb push_back
#define ALPHA 27
#define ll long long int
#define ld long double
#define len(s) (int)s.length()
#define all(a) a.begin(), a.end()

using namespace std;

const ll INF = (ll)(8e18);
const ll MOD = 1e9 + 7;

const int maxn = 500010;

int m,k,n,s;
int a[maxn], b[maxn];
vector < pair <int, int> > v,t;
vector <int> ans, tpp;
set <int> q;
map <int, int> mp, tp;

bool find(int x){
    int l = 0, r = (int)tpp.size() - 1;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(tpp[mid] > x){
            r = mid - 1;
        }else if(tpp[mid] < x) l = mid + 1;
        else return true;
    }
    return false;
}
void Empty(){
    t.clear();
    q.clear();
    tp.clear();
}

bool Possible(int h){
    Empty();
    assert(q.empty() == true);
    for(auto i : tpp){
        q.insert(i);
    }
    for(int i = 1; i <= h; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
    }
    if(q.empty()){
        t.pb(mk(1, h));
    }
    for(int i = h + 1; i <= m; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
        if(find(a[i - h])){
            tp[a[i - h]]--;
            if(tp[a[i - h]] < mp[a[i - h]] && q.find(a[i - h]) == q.end()){
                q.insert(a[i - h]);
            }
        }
        if(q.empty()){
            t.pb(mk(i - h + 1, i));
        }
    }
    return t.empty() == false;
}

bool check(){
    for(auto i : v){
         int req = i.S - i.F + 1 - k;
         req += (i.F - 1) % k;
         if(req <= m - k * n){
             for(int j = 1; j <= (i.F - 1) % k; j++){
                 ans.pb(j);
             }
             req -= (i.F - 1) % k;
             for(int j = i.F; j <= i.S; j++){
                 if(req == 0) break;
                 if(mp[a[j]] == 0){
                    ans.pb(j);
                    req--;
                 }
             }
             return false;
         }
    }
    return true;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++) cin >> a[i];
    for(int i = 1; i <= s; i++){
        cin >> b[i];
        mp[b[i]]++;
        tpp.pb(b[i]);
    }
    sort(all(tpp));
    tpp.erase(unique(all(tpp)), tpp.end());
    cerr << tpp.size() << '\n';
    int l = k, r = m / n;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(Possible(mid)){
            v = t;
            r = mid - 1;
        }else l = mid + 1;
    }
    if(v.empty() || check()){
        cout << -1 << '\n';
        return 0;
    }
    cout << (int)ans.size() << '\n';
    for(int i : ans) cout << i << ' ';
    cout << '\n';
    #ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}


#include <bits/stdc++.h>

#define IOS ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mmset(arr, n) memset(arr, n, sizeof arr)
#define deci(n) cout<<fixed<<setprecision(n);
#define F first
#define S second
#define mk make_pair
#define pb push_back
#define ALPHA 27
#define ll long long int
#define ld long double
#define len(s) (int)s.length()
#define all(a) a.begin(), a.end()

using namespace std;

const ll INF = (ll)(8e18);
const ll MOD = 1e9 + 7;

const int maxn = 500010;

int m,k,n,s;
int a[maxn], b[maxn];
vector < pair <int, int> > v,t;
vector <int> ans, tpp;
set <int> q;
map <int, int> mp, tp;

bool find(int x){
    int l = 0, r = (int)tpp.size() - 1;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(tpp[mid] > x){
            r = mid - 1;
        }else if(tpp[mid] < x) l = mid + 1;
        else return true;
    }
    return false;
}
void Empty(){
    t.clear();
    q.clear();
    tp.clear();
}

bool Possible(int h){
    Empty();
    assert(q.empty() == true);
    for(auto i : tpp){
        q.insert(i);
    }
    for(int i = 1; i <= h; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
    }
    if(q.empty()){
        t.pb(mk(1, h));
    }
    for(int i = h + 1; i <= m; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
        if(find(a[i - h])){
            tp[a[i - h]]--;
            if(tp[a[i - h]] < mp[a[i - h]] && q.find(a[i - h]) == q.end()){
                q.insert(a[i - h]);
            }
        }
        if(q.empty()){
            t.pb(mk(i - h + 1, i));
        }
    }
    return t.empty() == false;
}

bool check(){
    for(auto i : v){
         int req = i.S - i.F + 1 - k;
         req += (i.F - 1) % k;
         if(req <= m - k * n){
             for(int j = 1; j <= (i.F - 1) % k; j++){
                 ans.pb(j);
             }
             req -= (i.F - 1) % k;
             for(int j = i.F; j <= i.S; j++){
                 if(req <= 0) break;
                 if(find(a[j]) == false){
                    ans.pb(j);
                    req--;
                 }
             }
             return false;
         }
    }
    return true;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++) cin >> a[i];
    for(int i = 1; i <= s; i++){
        cin >> b[i];
        mp[b[i]]++;
        tpp.pb(b[i]);
    }
    sort(all(tpp));
    tpp.erase(unique(all(tpp)), tpp.end());
    int l = k, r = m;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(Possible(mid)){
            v = t;
            r = mid - 1;
        }else l = mid + 1;
    }
    if(v.empty() || check()){
        cout << -1 << '\n';
        return 0;
    }
    if(ans.empty()){
        cout << -1 << '\n';
        return 0;
    }
    cout << (int)ans.size() << '\n';
    for(int i : ans) cout << i << ' ';
    cout << '\n';
    #ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}


#include <bits/stdc++.h>

#define IOS ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mmset(arr, n) memset(arr, n, sizeof arr)
#define deci(n) cout<<fixed<<setprecision(n);
#define F first
#define S second
#define mk make_pair
#define pb push_back
#define ALPHA 27
#define ll long long int
#define ld long double
#define len(s) (int)s.length()
#define all(a) a.begin(), a.end()

using namespace std;

const ll INF = (ll)(8e18);
const ll MOD = 1e9 + 7;

const int maxn = 500010;

int m,k,n,s;
int a[maxn], b[maxn];
vector < pair <int, int> > v,t;
vector <int> ans, tpp;
set <int> q;
map <int, int> mp, tp;

bool find(int x){
    int l = 0, r = (int)tpp.size() - 1;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(tpp[mid] > x){
            r = mid - 1;
        }else if(tpp[mid] < x) l = mid + 1;
        else return true;
    }
    return false;
}
void Empty(){
    t.clear();
    q.clear();
    tp.clear();
}

bool Possible(int h){
    Empty();
    assert(q.empty() == true);
    for(auto i : tpp){
        q.insert(i);
    }
    for(int i = 1; i <= h; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
    }
    if(q.empty()){
        t.pb(mk(1, h));
    }
    for(int i = h + 1; i <= m; i++){
        if(find(a[i])){
            tp[a[i]]++;
            if(tp[a[i]] >= mp[a[i]] && q.find(a[i]) != q.end()){
                q.erase(a[i]);
            }
        }
        if(find(a[i - h])){
            tp[a[i - h]]--;
            if(tp[a[i - h]] < mp[a[i - h]] && q.find(a[i - h]) == q.end()){
                q.insert(a[i - h]);
            }
        }
        if(q.empty()){
            t.pb(mk(i - h + 1, i));
        }
    }
    return t.empty() == false;
}

bool check(){
    for(auto i : v){
         int req = i.S - i.F + 1 - k;
         req += (i.F - 1) % k;
         if(req <= m - k * n){
              tp.clear();
             for(int j = i.F; j <= i.S; j++) tp[a[j]]++;
             for(int j = 1; j <= (i.F - 1) % k; j++){
                 ans.pb(j);
             }
             req -= (i.F - 1) % k;
             for(int j = i.F; j <= i.S; j++){
                 if(req <= 0) break;
                 if(find(a[j]) == false){
                    ans.pb(j);
                    req--;
                 }else{
                     if(tp[a[j]] > mp[a[j]]){
                         tp[a[j]]--;
                         req--;
                         ans.pb(j);
                     }
                 }
             }
             return false;
         }
    }
    return true;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++) cin >> a[i];
    for(int i = 1; i <= s; i++){
        cin >> b[i];
        mp[b[i]]++;
        tpp.pb(b[i]);
    }
    sort(all(tpp));
    tpp.erase(unique(all(tpp)), tpp.end());
    int l = k, r = m;
    while(l <= r){
        int mid = l + (r - l) / 2;
        if(Possible(mid)){
            v = t;
            r = mid - 1;
        }else l = mid + 1;
    }
    if(v.empty() || check()){
        cout << -1 << '\n';
        return 0;
    }
    cout << (int)ans.size() << '\n';
    for(int i : ans) cout << i << ' ';
    cout << '\n';
    #ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}


// DAY  : 26 / 09 / 2019
// TIME : 13 / 38 / 12
//*Wild.Stone - IIT Roorkee*

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>

#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pretime float(clock()-clk)/CLOCKS_PER_SEC
#define rep(i,a,b) for(i=a;i<=b;++i)
#define rev(i,a,b) for(i=a;i>=b;--i)
#define max2(a,b) ((a)>(b)?(a):(b))
#define min2(a,b) ((a)<(b)?(a):(b))
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define ll long long int
#define ins insert
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
#define inf 1000000000000000
#define bug(x) cerr<<#x<<" = "<<(x)<<'\n'

using namespace std;
typedef pair<ll,ll>     pll;
typedef pair<int,int>   pii;
typedef vector<ll>      vll;
typedef vector<int>      vi;
typedef vector< pll >  vpll;
typedef vector< pii >  vpii;
typedef set<ll>         sll;
typedef set<int>         si;
clock_t clk=clock();

ll i,j,k;
void solve(void);

int main()
{
  speedio;
   int t=1;
  // cin>>t;
   while(t--)
     solve();

  return 0;
}
// #define cerr if(0)cerr

void solve()
{
	cout<<"saklfj";
}


#include<bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for(i=(a);i<=(b);++i)
#define rev(i,a,b) for(i=(a);i>=(b);--i)
#define max2(a,b)  ((a)>(b)?(a):(b))
#define min2(a,b)  ((a)<(b)?(a):(b))
#define all(x) x.begin(),x.end()
#define sz(x) (long long)x.size()
#define fi first
#define se second
#define pb emplace_back // push_back
#define mp make_pair
#define endl '\n'

#ifdef Wild4Stone
template<typename T>
void __p(T a) { cout << a << " "; }
template<typename T, typename F>
void __p(pair<T, F> a) { cout << "{ "; __p(a.fi); __p(a.se); cout << "}"; }
template<typename T>
void __f(const char* s, T t) { cout << s << " : "; __p(t); }
template<typename T>
void __t(const char* s, const T &x) { cout << s << " : { "; for (auto it : x) __p(it); cout << "} ";}
template<typename T, typename ... F>
void __f(const char* s, T t, F ... f) {
	int i = 0; for (;; ++i) if (s[i] == ',') break;
	cout.write(s, i) << " : "; __p(t); cout << " | "; __f(s + i + 1, f...);
}
#define trace(...) { cout<<"LINE: "<<__LINE__<<" || "; __f(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
#define autra(...) { cout<<"LINE: "<<__LINE__<<" || "; __t(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
#else
#define trace(...) {}
#define autra(...) {}
#endif

typedef long long int ll;
typedef pair<ll, ll> pll;

const ll mod = 1000000007;  //998244353;
const ll inf = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
const double PI = acos(-1);

ll i, j, k;
void solve(void);
inline bool equal(double a, double b) { return fabs(a - b) < eps; }
// inline ll gcd(ll a, ll b) { a=abs(a); b=abs(b); while(a>0 && b>0) (a>b?a%=b:b%=a); return (a==0?b:a); }
// inline ll power(ll x, ll n, ll m = LLONG_MAX)
//        {  ll res=1; x = (x%m + m)%m;
//             while(n) { if(n&1) res=(res*x)%m;  x=(x*x)%m;  n >>= 1; }  return res;
//        }

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	int t = 1;
	// cin>>t;
	while (t--)  solve();
	return 0;
}

//***************** Code Starts Here *******************//

void solve()
{
	ll m, k, n, s; cin >> m >> k >> n >> s;
	ll a[m + 1] = {0}; rep(i, 1, m) cin >> a[i];

	map<ll, ll> b;
	rep(i, 1, s)
	{
		ll x; cin >> x;
		b[x]++;
	}

	ll ans = mod, r = 0, ct = 0;
	map<ll, ll> t;

	rep(i, 1, m)
	{
		while (ct < sz(b) && r < m)
		{
			++r;
			++t[a[r]];

			if (b.find(a[r]) != b.end())
				if (t[a[r]] == b[a[r]])
					++ct;
		}

		if (ct == sz(b))
		{
			ans = min2(r - i + 1, ans);
			--t[a[i]];

			if (b.find(a[i]) != b.end())
				if (t[a[i]] == b[a[i]] - 1)
					--ct;
		}
		else
			break;
	}

	if (ans == mod)
	{
		cout << "-1" << endl;
		return;
	}
	t.clear();

	rep(i, 1, ans)
	++t[a[i]];

	ct = 0;

	for (auto it : b)
		if (t.find(it.fi) != t.end())
			if (t[it.fi] >= it.se)
				++ct;

	if (ct == sz(b))
	{
		int st = 1, en = k, siz = ans;
		int beg = 1, last = 1 + ans - 1;

		int val = min2(beg - st, max2(0, last - en));
		int rem = 0;

		beg -= val;
		last -= val;
		rem += val;

		val = min2(ans - s, max2(0, last - en));
		last -= val;
		rem += val;

		if (last <= en && (m - rem) >= k * n)
		{
			vector<int> v;
			int st = 1, en = k;
			int beg = 1, last = 1 + ans - 1;

			rep(j, st, beg - 1) v.pb(j);

			t.clear();
			rep(j, beg, last)
			{
				++t[a[j]];

				if (b.find(a[j]) != b.end())
				{
					if (t[a[j]] > b[a[j]])
						v.pb(j);
				}
				else v.pb(j);
			}

			cout << rem << endl;
			rep(j, 0, rem - 1) cout << v[j] << " ";
			cout << endl;
			return;
		}
	}

	rep(i, ans + 1, m)
	{
		--t[a[i - ans]];

		if (b.find(a[i - ans]) != b.end())
			if (t[a[i - ans]] == b[a[i - ans]] - 1)
				--ct;

		++t[a[i]];

		if (b.find(a[i]) != b.end())
			if (t[a[i]] == b[a[i]])
				++ct;

		if (ct == sz(b))
		{
			int beg = i - ans + 1, last = i;
			int st = ((beg - 1) / k) * k + 1, en = st + k - 1;
			int val = min2(beg - st, max2(0, last - en));
			int rem = 0;

			beg -= val;
			last -= val;
			rem += val;

			val = min2(ans - s, max2(0, last - en));
			last -= val;
			rem += val;

			if (last <= en && (m - rem) >= k * n)
			{
				trace(i);
				vector<int> v;
				int beg = i - ans + 1, last = i;
				int st = ((beg - 1) / k) * k + 1, en = st + k - 1;

				rep(j, st, beg - 1) v.pb(j);

				t.clear();
				rep(j, beg, last)
				{
					++t[a[j]];

					if (b.find(a[j]) != b.end())
					{
						if (t[a[j]] > b[a[j]])
							v.pb(j);
					}
					else v.pb(j);
				}

				cout << rem << endl;
				rep(j, 0, rem - 1) cout << v[j] << " ";
				cout << endl;
				return;
			}
		}

	}
	cout << "-1\n";
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 5e5 + 5;
int out[N];
int arr[N];
int freq1[N];
int freq2[N];
int temp[N];

int main ()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int m, k, n, s;
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++)
        cin >> arr[i];
    for(int i = 0; i < s; i++)
    {
        int a;
        cin >> a;
        freq2[a]++;
    }
    int same = 0;
    for(int i = 0; i < N; i++)
        if(freq2[i] == 0)
            same++;
    int rem = m - n * k;
    int p = INT_MAX;
    int idx = 1;
    for(int i = 1; i <= n; i++)
    {
        int st_pos = k * (i - 1) + 1;
        if(i != 1)
        {
            int pre = k * (i - 2) + 1;
            for(int i = pre;  i < st_pos; i++)
            {
                freq1[arr[i]]--;
                if(freq1[arr[i]] + 1 == freq2[arr[i]])
                    same--;
            }
        }
        while(same < N && idx <= m)
        {
            freq1[arr[idx]]++;
            if(freq1[arr[idx]] == freq2[arr[idx]])
                same++;
            idx++;
        }
        while((idx - st_pos) < k)
        {
            freq1[arr[idx]]++;
            if(freq1[arr[idx]] == freq2[arr[idx]])
                same++;
            idx++;
        }
        if(same != N)
            break;
        int len = (idx - st_pos);
        int o = len - k;
        if(o < p && o <= rem){
            for(int i = st_pos; i < idx; i++)
            {
                temp[arr[i]] = freq1[arr[i]] - freq2[arr[i]];
            }
            int cur = o;
            p = 0;
            for(int i = st_pos; i < idx; i++)
            {
                if(temp[arr[i]])
                {
                    if(cur)
                    {
                        out[p++] = i;
                        cur--;
                    }
                    temp[arr[i]]--;
                }
            }
            int en = k * n + 1 + o;
            for(int i = en; i <= m; i++)
                out[p++] = i;
        }
    }
    if(p == INT_MAX)
        cout << -1;
    else
    {
        cout << p << '\n';
        for(int i = 0; i < p; i++)
            cout << out[i] << ' ';
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 5e5 + 5;
int out[N];
int arr[N], arr2[N];
int p;
int freq1[N];
int freq2[N];
int temp[N];

int main ()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int m, k, n, s;
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++)
        cin >> arr[i];
    for(int i = 0; i < s; i++)
        cin >> arr2[i];
    sort(arr2, arr2 + s);
    for(int i = 0; i < s; i++)
        freq2[arr2[i]]++;
    int same = 0;
    for(int i = 0; i < N; i++)
        if(freq2[i] == 0)
            same++;
    int rem = m - n * k;
    int sol = INT_MAX;
    int idx = 1;
    for(int i = 1; i <= n; i++)
    {
        int st_pos = k * (i - 1) + 1;
        if(i != 1)
        {
            int pre = k * (i - 2) + 1;
            for(int i = pre;  i < st_pos; i++)
            {
                freq1[arr[i]]--;
                if(freq1[arr[i]] + 1 == freq2[arr[i]])
                    same--;
            }
        }
        while(same < N && idx <= m)
        {
            freq1[arr[idx]]++;
            if(freq1[arr[idx]] == freq2[arr[idx]]){
                same++;
            }
            idx++;
        }
        if(same != N)
            break;
        int len = (idx - st_pos);
        int o = len - k;
        if(o < sol && o <= rem){
            sol = o;
            for(int i = st_pos; i < idx; i++)
            {
                temp[arr[i]] = freq1[arr[i]] - freq2[arr[i]];
            }
            int cur = o;
            for(int i = st_pos; i < idx; i++)
            {
                if(temp[arr[i]])
                {
                    if(cur){
                        out[p++] = i;
                        cur--;
                    }
                    temp[arr[i]]--;
                }
            }
            int en = k * n + 1 + o;
            for(int i = en; i <= m; i++)
                out[p++] = i;
        }
    }
    if(sol == INT_MAX)
        cout << -1;
    else
    {
        cout << p << '\n';
        for(int i = 0; i < p; i++)
            cout << out[i] << ' ';
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 5e5 + 5;
vector<int> tree[4 * N];
int arr[N];
int arr2[N];

void mer(vector<int> &v1, vector<int> &v2, vector<int> &v3)
{
    int idx1 = 0, idx2 = 0;
    while(idx1 < v1.size() && idx2 < v2.size())
    {
        if(v1[idx1] <= v2[idx2])
        {
            v3.push_back(v1[idx1]);
            idx1++;
        }
        else
        {
            v3.push_back(v2[idx2]);
            idx2++;
        }
    }
    while(idx1 < v1.size())
    {
        v3.push_back(v1[idx1]);
        idx1++;
    }
    while(idx2 < v2.size())
    {
        v3.push_back(v2[idx2]);
        idx2++;
    }
}

void build(int node, int l, int r)
{
    if(l == r)
    {
        tree[node].push_back(arr[l]);
        return;
    }
    int mid = (l + r) >> 1;
    build(node << 1, l, mid);
    build((node << 1) + 1, mid + 1, r);
    mer(tree[(node << 1)], tree[(node << 1) + 1], tree[node]);
}

vector<int> get_range(int node, int l, int r, int st, int en)
{
    if(st > r || en < l)
        return vector<int>();
    if(st <= l && r <= en)
    {
        return tree[node];
    }
    int mid = (l + r) >> 1;
    vector<int> ret1 = get_range((node << 1), l, mid, st, en);
    vector<int> ret2 = get_range((node << 1) + 1, mid + 1, r, st, en);
    vector<int> ret;
    mer(ret1, ret2, ret);
    return ret;
}

int mark[N];
int out[N];
int p;

int main ()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int m, k, n, s;
    cin >> m >> k >> n >> s;
    for(int i = 1; i <= m; i++)
        cin >> arr[i];
    for(int i = 0; i < s; i++)
        cin >> arr2[i];
    sort(arr2, arr2 + s);
    build(1, 1, m);
    int rem = m - n * k;
    int sol = INT_MAX;
    for(int i = 1; i <= n; i++)
    {
        int st_pos = k * (i - 1) + 1;
        int st = st_pos + k - 1, en = min(m, st_pos + k - 1 + rem), ans = -1;
        while(st <= en)
        {
            int mid = (st + en) >> 1;
            vector<int> vec = get_range(1, 1, m, st_pos, mid);
            int idx1 = 0, idx2 = 0;
            while(idx1 < vec.size() && idx2 < s)
            {
                if(vec[idx1] == arr2[idx2])
                    idx2++;
                idx1++;
            }
            if(idx2 == s)
            {
                ans = mid;
                en = mid - 1;
            }
            else
            {
                st = mid + 1;
            }
        }
        if(ans == -1)
            continue;
        int len = (ans - st_pos + 1);
        int cur = len - k;
        if(cur < sol)
        {
            sol = len - k;
            vector<int> vec = get_range(1, 1, m, st_pos, ans);
            int idx1 = 0, idx2 = 0;
            while(idx1 < vec.size())
            {
                if(idx2 < s && vec[idx1] == arr2[idx2])
                    idx2++;
                else
                    mark[vec[idx1]]++;
                idx1++;
            }
            p = 0;
            for(int j = st_pos; j <= ans; j++)
            {
                if(mark[arr[j]] == 0)
                    continue;
                if(cur){

                    out[p++] = j;
                    cur--;
                }
                mark[arr[j]]--;
            }
            int idx = k * (n) + 1 + len - k;
            for(int j = idx; j <= m; j++)
            {
                out[p++] = j;
            }
        }
    }
    if(sol == INT_MAX)
        cout << -1;
    else
    {
        cout << p << '\n';
        for(int i = 0; i < p; i++)
            cout << out[i] << ' ';
    }
    return 0;
}