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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Task {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA s = new TaskA();
		s.solve(in, out);
		out.close();
	}
}

class TaskA {
	public void solve(InputReader in, PrintWriter out) {
		int n=in.nextInt();
		int m=in.nextInt();
		int p=in.nextInt();
		
		
		if((n-1)/p<m-1 || m>n){
			out.println(0);
			return;
		}
		
		int[] a=new int[n+1];
		int[] b=new int[m+1];
		for(int i=0;i<n;i++){
			a[i+1]=in.nextInt();
		}
		for(int i=0;i<m;i++){
			b[i+1]=in.nextInt();
		}
		
		Arrays.sort(b);
		
		int cnt=0;
		int[] c=new int[m+1];
		
		for(int i=1;i<=m;i++){
			if(b[i]==b[i-1]){
				c[cnt]++;
			}else{
				cnt++;
				c[cnt]=1;
				b[cnt]=b[i];
			}
		}
		
		int[] res=new int[n+1];
		int ans=0;
		
		int[] v=new int[cnt+1];
		
		for(int i=1;i<=n;i++){
			int loc=-1;
			int l=1;
			int r=cnt+1;
			int mid=(l+r)/2;
			while(r>l){
				if(a[i]>b[mid])
					l=mid+1;
				else if(a[i]<b[mid])
					r=mid-1;
				else
					break;
				mid=(r+l)/2;
			}
			if(b[mid]==a[i])
				a[i]=mid;
			else
				a[i]=-1;
		}
		
		for(int i=1;i<=p;i++){
			Arrays.fill(v, 0);
			long abs=0;
			int start=Integer.MIN_VALUE;
			for(int j=i;j<=n;j+=p){
				if(j==30){
					System.out.println();
				}
				if(a[j]==-1){
					Arrays.fill(v, 0);
					abs=0;
					start=Integer.MIN_VALUE;
					continue;
				}else{
					if(start==Integer.MIN_VALUE)
						start=j;
					v[a[j]]++;
					if(v[a[j]]==c[a[j]])
						abs+=c[a[j]];
					if(v[a[j]]==c[a[j]]+1)
						abs-=c[a[j]];
					
					if(j-start==m*p){
						v[a[start]]--;
						if(v[a[start]]==c[a[start]])
							abs+=c[a[start]];
						if(v[a[start]]==c[a[start]]-1)
							abs-=c[a[start]];
						
						start+=p;
					}
					
					if(j-start==(m-1)*p){
						if(abs==m){
							res[ans++]=start;
						}
					}
				}
			}
		}
		
		out.println(ans);
		Arrays.sort(res,0,ans);
		
		for(int i=0;i<ans;i++){
			if(i==0)
				out.print(res[i]);
			else
				out.print(" "+res[i]);
		}
		out.println();
	}
	
	
}

class InputReader {
	private BufferedReader reader;
	private StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream));
		tokenizer = null;
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

}