Sereja has two sequences a and b and number p. Sequence a consists of n integers a1, a2, ..., an. Similarly, sequence b consists of m integers b1, b2, ..., bm. As usual, Sereja studies the sequences he has. Today he wants to find the number of positions q (q + (m - 1)·p ≤ n; q ≥ 1), such that sequence b can be obtained from sequence aq, aq + p, aq + 2p, ..., aq + (m - 1)p by rearranging elements.

Sereja needs to rush to the gym, so he asked to find all the described positions of q.

Input

The first line contains three integers n, m and p (1 ≤ n, m ≤ 2·105, 1 ≤ p ≤ 2·105). The next line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109). The next line contains m integers b1, b2, ..., bm (1 ≤ bi ≤ 109).

Output

In the first line print the number of valid qs. In the second line, print the valid values in the increasing order.

Examples

Input

5 3 1
1 2 3 2 1
1 2 3


Output

2
1 3


Input

6 3 2
1 3 2 2 3 1
1 2 3


Output

2
1 2
import java.util.*;
import java.io.*;
public class Main {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                    {
                        temp/=10;
                        doub+=(n-'0')*temp;
                        n=scan();
                    }
                    else throw new InputMismatchException();
                }
            }
            return doub*neg;
        }
        public String scanString()throws IOException
        {
            StringBuilder sb=new StringBuilder();
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            while(!isWhiteSpace(n))
            {
                sb.append((char)n);
                n=scan();
            }
            return sb.toString();
        }
        private boolean isWhiteSpace(int n)
        {
            if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
            return true;
            return false;
        }
    }
    
    public static void sort(int arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(int arr[],int l1,int r1,int l2,int r2) {
        int tmp[]=new int[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }
    
    public static void sort(long arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(long arr[],int l1,int r1,int l2,int r2) {
        long tmp[]=new long[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }
    
    public static void main(String args[]) throws IOException {
        Scan input=new Scan();
        StringBuilder ans=new StringBuilder("");
        int n=input.scanInt();
        int m=input.scanInt();
        int p=input.scanInt();
        int arr[]=new int[n];
        for(int i=0;i<n;i++) {
            arr[i]=input.scanInt();
        }
        int brr[]=new int[m];
        for(int i=0;i<m;i++) {
            brr[i]=input.scanInt();
        }
        coord_comp(n,m,arr,brr);
        int fin_freq[]=new int[n+m];
        int zero=0;
        for(int i=0;i<m;i++) {
            fin_freq[brr[i]]++;
        }
        for(int i=0;i<fin_freq.length;i++) {
            zero+=(fin_freq[i]==0?1:0);
        }
        int total=0;
        ArrayList<Integer> fin=new ArrayList<>();
        int freq[]=new int[n+m];
        boolean state[]=new boolean[n+m];
        for(int i=0;i<p;i++) {
            int cnt=freq.length-zero;
            for(int j=i,no=1;j<n;j+=p,no++) {
                if(freq[arr[j]]==0 && fin_freq[arr[j]]==0) {
                    state[arr[j]]=true;
                }
                if(no>m) {
                    freq[arr[j-m*p]]--;
                    if(freq[arr[j-m*p]]==fin_freq[arr[j-m*p]]) {
                        if(!state[arr[j-m*p]]) {
                            state[arr[j-m*p]]=true;
                            cnt--;
                        }
                    }
                    else {
                        if(state[arr[j-m*p]]) {
                            state[arr[j-m*p]]=false;
                            cnt++;
                        }
                    }
                }
                freq[arr[j]]++;
                if(freq[arr[j]]==fin_freq[arr[j]]) {
                    if(!state[arr[j]]) {
                        state[arr[j]]=true;
                        cnt--;
                    }
                }
                else {
                    if(state[arr[j]]) {
                        state[arr[j]]=false;
                        cnt++;
                    }
                }
                if(no>=m) {
                    if(cnt==0) {
                        total++;
                        fin.add((j-(m-1)*p)+1);
                    }
                }
//                System.out.println(i+" "+j+" "+no+" "+cnt);
            }
            for(int j=i;j<n;j+=p) {
                freq[arr[j]]=0;
                state[arr[j]]=false;
            }
        }
        ans.append(total+"\n");
        fin.sort(null);
        for(int i=0;i<fin.size();i++) {
            ans.append(fin.get(i)+" ");
        }
        System.out.println(ans);
    }
    public static void coord_comp(int n,int m,int arr[],int brr[]) {
        int crr[]=new int[n+m];
        for(int i=0;i<n;i++) {
            crr[i]=arr[i];
        }
        for(int i=0;i<m;i++) {
            crr[n+i]=brr[i];
        }
        sort(crr,0,n+m-1);
        HashMap<Integer,Integer> map=new HashMap<>();
        int cnt=0;
        for(int i=0;i<crr.length;i++) {
            if(!map.containsKey(crr[i])) {
                map.put(crr[i], cnt);
                cnt++;
            }
        }
        for(int i=0;i<n;i++) {
            arr[i]=map.get(arr[i]);
        }
        for(int i=0;i<m;i++) {
            brr[i]=map.get(brr[i]);
        }
    }
}
