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.List;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.HashMap;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author karan173
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskD
{
    int[] cnt;
    public void solve(int testNumber, FastReader in, PrintWriter out)
    {
        int n = in.ni ();
        int m = in.ni ();
        int p = in.ni ();
        int a[] = new int[n];
        int b[] = new int[m];
        int c[] = new int[n + m];
        for (int i = 0; i < n; i++)
        {
            a[i] = c[i] = in.ni ();

        }
        for (int i = 0; i < m; i++)
        {
            b[i] = c[i+n] = in.ni ();
        }
        Arrays.sort (c);
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer> ();
        int dis = 0;
        for (int i = 0; i < c.length; i++)
        {
            int j;
            map.put (c[i], dis++);
            for (j = i + 1; j < c.length && c[j] == c[i]; j++) ;
            i = j-1;
        }
        for (int i = 0; i < n; i++)
        {
            a[i] = map.get (a[i]);
        }

        cnt = new int[dis];
        int mis = 0;
        for (int i = 0; i < m; i++)
        {
            b[i] = map.get (b[i]);
            if (cnt[b[i]] == 0)
            {
               mis++;
            }
            cnt[b[i]]++;
        }
//        out.println (Arrays.toString (b));

        ArrayList<Integer> ans = new ArrayList<Integer> ();
        for (int i = 0; i < p; i++)       //offsets
        {
            int num = n - 1 - i + 1;
            if (num % p == 0)
            {
                num /= p;
            }
            else
            {
                num = num/p+1;
            }
            if (num < m)
            {
                continue;
            }
            int d[] = new int[num];
            int ctr = 0;
            for (int j = i; j < n; j += p, ctr++)
            {
                d[ctr] = a[j];
            }
//            out.println (i + " "  + Arrays.toString (d));
//            if (ctr != num)
//            {
//                throw new RuntimeException ();
//            }
            int newCnt[] = new int[dis];
            for (int j = 0; j < newCnt.length; j++)
            {
                newCnt[j] = cnt[j];
            }

            int misCnt = mis;
            //do for first window
            for (int j = 0; j < ctr && j < m; j++)
            {
                int x = d[j];
                newCnt[x]--;
                if (newCnt[x] == -1)
                {
                    misCnt++;
                }
                if (newCnt[x] == 0)
                {
                    misCnt--;
                }
            }
            int l = 0, r = m-1;
//            out.print ("---");
//            for (int j = l; j <= r; j++)
//            {
//                out.print (d[j] + " ");
//            }
//            out.println (Arrays.toString (newCnt) + "  " + misCnt);
            if (misCnt == 0)
            {
                ans.add (i + 1);
//                out.println (l * p + i + " " + i + " " + l);
            }
            l++;r++;
            while (r<ctr)
            {
                newCnt[d[l-1]]++;
                if (newCnt[d[l-1]] == 1)
                {
                    misCnt++;
                }
                else if (newCnt[d[l-1]] == 0)
                {
                    misCnt--;
                }
                newCnt[d[r]]--;
                if (newCnt[d[r]] == -1)
                {
                    misCnt++;
                }
                else if (newCnt[d[r]] == 0)
                {
                    misCnt--;
                }
                if (misCnt == 0)
                {
                    ans.add (i + l * p+1);
//                    out.println (l * p + i  + " " + i + " " + l );
                }
//                out.print ("---");
//                for (int j = l; j <= r; j++)
//                {
//                    out.print (d[j] + " ");
//                }
//                out.println (Arrays.toString (newCnt) + "  " + misCnt);
                l++;
                r++;
            }
        }

        Collections.sort (ans);
//        out.println (ans);
        out.println (ans.size ());
        if (ans.size () == 0)
        {
            return;
        }
        for (int i = 0; i < ans.size () - 1; i++)
        {
            out.print (ans.get (i)+ " ");
        }
        out.println (ans.get (ans.size ()-1));
    }
}

class FastReader
{

    public InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastReader(InputStream stream)
    {
        this.stream = stream;
    }

    public int read()
    {
        if (numChars == -1)
        {
            throw new InputMismatchException ();
        }
        if (curChar >= numChars)
        {
            curChar = 0;
            try
            {
                numChars = stream.read (buf);
            } catch (IOException e)
            {
                throw new InputMismatchException ();
            }
            if (numChars <= 0)
            {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int ni()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-')
        {
            sgn = -1;
            c = read ();
        }
        int res = 0;
        do
        {
            if (c < '0' || c > '9')
            {
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c)
    {
        if (filter != null)
        {
            return filter.isSpaceChar (c);
        }
        return isWhitespace (c);
    }

    public static boolean isWhitespace(int c)
    {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter
    {
        public boolean isSpaceChar(int ch);
    }
}
