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
#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b < a) {
    long long int temp = a;
    a = b;
    b = temp;
  }
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int lcm(long long int a, long long int b) {
  return (a * b / gcd(a, b));
}
long long int fact(long long int x) {
  long long int ans = 1;
  if (x == 0) {
    return 1;
  }
  while (x > 0) {
    ans = (ans * x) % 1000000007;
    x--;
  }
  return ans % 1000000007;
}
long long int comb(long long int n, long long int r) {
  long long int x = fact(r), y = fact(n - r);
  x = (x * y) % 1000000007;
  if (fact(n) > x) return fact(n) / x;
  return (fact(n) + 1000000007) / x;
}
long long int power(long long int a, long long int p) {
  long long int ans = 1;
  while (p > 0) {
    if (p % 2) {
      ans *= a;
      ans %= 1000000007;
    }
    a *= a;
    a %= 1000000007;
    p /= 2;
  }
  return ans % 1000000007;
}
long long int dist(long long int x1, long long int y1, long long int x2,
                   long long int y2) {
  return (1.0 * (x1 - x2) * (x1 - x2) + 1.0 * (y1 - y2) * (y1 - y2));
}
vector<long long int> getbinary(long long int x) {
  vector<long long int> bin(20000, 0);
  long long int iter = 0;
  while (x > 0) {
    if (x % 2 == 1) {
      bin[iter] = 1;
    } else {
      bin[iter] = 0;
    }
    iter++;
    x /= 2;
  }
  return bin;
}
int main() {
  long long int n, m, p, i, f, j;
  cin >> n >> m >> p;
  long long int a[n], b[m];
  vector<long long int> c, d, ans;
  map<long long int, long long int> x;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < m; i++) cin >> b[i];
  sort(b, b + m);
  x[b[0]] = 1;
  d.push_back(1);
  for (i = 1; i < m; i++) {
    if (b[i] == b[i - 1]) {
      d[d.size() - 1]++;
    } else {
      d.push_back(1);
      x[b[i]] = d.size();
    }
  }
  for (i = 0; i < p; i++) {
    f = i;
    for (j = i; j < n; j += p) {
      if (x[a[j]] == 0) {
        for (; f < j; f += p) {
          d[x[a[f]] - 1]++;
        }
        f += p;
      } else if (d[x[a[j]] - 1] == 0) {
        while (a[f] != a[j]) {
          d[x[a[f]] - 1]++;
          f += p;
        }
        d[x[a[f]] - 1]++;
        f += p;
      }
      if (d[x[a[j]] - 1] != 0 && x[a[j]]) {
        d[x[a[j]] - 1]--;
        if ((j - f) / p + 1 == m) {
          ans.push_back(f);
          d[x[a[f]] - 1]++;
          f += p;
        }
      }
    }
    while (f < n) {
      d[x[a[f]] - 1]++;
      f += p;
    }
  }
  cout << ans.size() << endl;
  sort(ans.begin(), ans.end());
  for (i = 0; i < ans.size(); i++) cout << ans[i] + 1 << " ";
}
