#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int Set(int n, int pos) { return n = n | (1 << pos); }
bool check(int n, int pos) { return (bool)(n & (1LL << pos)); }
int reset(int n, int pos) { return n = n & ~(1 << pos); }
int dx[] = {0, 0, 1, -1};
int dy[] = {-1, 1, 0, 0};
long long ex = 1021, ex2 = 1297;
long long invi[200050], invi2[200050], po[200050], po2[200050];
int hashi[3][27][200050], hashi2[3][27][200050], nwe[3][27][200050];
pair<int, int> extendedEuclid(long long a, long long b) {
  if (b == 0)
    return pair<int, int>(1, 0);
  else {
    pair<int, int> d = extendedEuclid(b, a % b);
    return pair<int, int>(d.second, d.first - d.second * (a / b));
  }
}
int modularInverse(long long a, int n) {
  pair<int, int> ret = extendedEuclid(a, n);
  return ((ret.first % n) + n) % n;
}
char str[3][200050];
void preparehash(int id, int v) {
  long long mul = ex, mul2 = ex2, g;
  for (long long i = 1; str[id][i]; i++) {
    if (str[id][i] - 96 != v)
      g = 0;
    else
      g = i;
    hashi[id][v][i] = (g * mul) % 1000000007;
    hashi2[id][v][i] = (g * mul2) % 1000000009;
    mul = (mul * ex) % 1000000007;
    mul2 = (mul2 * ex2) % 1000000009;
    if (i) hashi[id][v][i] += hashi[id][v][i - 1];
    if (i) hashi2[id][v][i] += hashi2[id][v][i - 1];
    hashi[id][v][i] %= 1000000007;
    hashi2[id][v][i] %= 1000000009;
    if (id == 0) {
      nwe[0][v][i] = (g != 0) * po[i];
      nwe[1][v][i] = (g != 0) * po2[i];
      nwe[0][v][i] += nwe[0][v][i - 1];
      nwe[1][v][i] += nwe[1][v][i - 1];
      nwe[0][v][i] %= 1000000007;
      nwe[1][v][i] %= 1000000009;
    }
  }
}
long long cal2(int id, int lo, int high, int v, int md) {
  int g;
  g = nwe[id][v][lo - 1];
  long long ret = nwe[id][v][high] - g;
  if (ret < 0) ret = (ret + md) % md;
  return (ret * (lo - 1)) % md;
}
void pre(int n) {
  po[0] = 1;
  po2[0] = 1;
  invi[0] = modularInverse(po[0], 1000000007);
  invi2[0] = modularInverse(po2[0], 1000000009);
  for (int i = 1; i <= n; i++) {
    po[i] = (po[i - 1] * ex) % 1000000007;
    po2[i] = (po2[i - 1] * ex2) % 1000000009;
    invi[i] = modularInverse(po[i], 1000000007);
    invi2[i] = modularInverse(po2[i], 1000000009);
  }
}
map<pair<long long, long long>, int> name;
pair<int, int> paku;
long long temp[28], temp2[28];
int ara[200050], cnt, vis[27];
long long cal(int kto, int kon, int indx) {
  if (kto == 1) return hashi[0][kon][indx];
  return hashi2[0][kon][indx];
}
int ase[28];
int main() {
  int i, j, k, l, m, n, lo;
  scanf("%d%d", &n, &m);
  pre(n);
  scanf("%s%s", str[0] + 1, str[1] + 1);
  for (int i = 1; str[1][i]; i++) {
    ase[str[1][i] - 96] = 1;
  }
  for (int i = 1; i <= 26; i++) {
    preparehash(0, i);
    preparehash(1, i);
  }
  for (int i = m; str[0][i]; i++) {
    lo = i - m + 1;
    memset(vis, 0, sizeof vis);
    name.clear();
    for (int j = 1; j <= 26; j++) {
      temp[j] = hashi[0][j][i] - cal(1, j, lo - 1);
      temp2[j] = hashi2[0][j][i] - cal(2, j, lo - 1);
      if (temp[j] < 0) temp[j] = (temp[j] + 1000000007) % 1000000007;
      if (temp2[j] < 0) temp2[j] = (temp2[j] + 1000000009) % 1000000009;
      temp[j] -= cal2(0, lo, i, j, 1000000007);
      temp2[j] -= cal2(1, lo, i, j, 1000000009);
      if (temp[j] < 0) temp[j] = (temp[j] + 1000000007) % 1000000007;
      if (temp2[j] < 0) temp2[j] = (temp2[j] + 1000000009) % 1000000009;
      temp[j] = (temp[j] * invi[lo - 1]) % 1000000007;
      temp2[j] = (temp2[j] * invi2[lo - 1]) % 1000000009;
      name[make_pair(temp[j], temp2[j])] = j;
    }
    for (j = 1; j <= 26; j++) {
      if (ase[j] == 0) continue;
      paku = make_pair(hashi[1][j][m], hashi2[1][j][m]);
      l = name[paku];
      if (l == 0) break;
      if (vis[j] && vis[j] != l) break;
      if (vis[j] && l == vis[j]) continue;
      k = vis[l];
      if (k && k != j) break;
      if (k == j) continue;
      vis[j] = l;
      vis[l] = j;
    }
    if (j == 27) ara[++cnt] = lo;
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) {
    printf("%d ", ara[i]);
  }
}

### Prompt

Construct a Cpp code solution to the problem outlined:

Polycarp invented a new way to encode strings. Let's assume that we have string T, consisting of lowercase English letters. Let's choose several pairs of letters of the English alphabet in such a way that each letter occurs in at most one pair. Then let's replace each letter in T with its pair letter if there is a pair letter for it. For example, if you chose pairs (l, r), (p, q) and (a, o), then word "parallelogram" according to the given encoding principle transforms to word "qolorreraglom".

Polycarpus already has two strings, S and T. He suspects that string T was obtained after applying the given encoding method from some substring of string S. Find all positions mi in S (1 ≤ mi ≤ |S| - |T| + 1), such that T can be obtained fro substring SmiSmi + 1... Smi + |T| - 1 by applying the described encoding operation by using some set of pairs of English alphabet letters

Input

The first line of the input contains two integers, |S| and |T| (1 ≤ |T| ≤ |S| ≤ 2·105) — the lengths of string S and string T, respectively.

The second and third line of the input contain strings S and T, respectively. Both strings consist only of lowercase English letters.

Output

Print number k — the number of suitable positions in string S.

In the next line print k integers m1, m2, ..., mk — the numbers of the suitable positions in the increasing order.

Examples

Input

11 5
abacabadaba
acaba


Output

3
1 3 7


Input

21 13
paraparallelogramgram
qolorreraglom


Output

1
5

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int Set(int n, int pos) { return n = n | (1 << pos); }
bool check(int n, int pos) { return (bool)(n & (1LL << pos)); }
int reset(int n, int pos) { return n = n & ~(1 << pos); }
int dx[] = {0, 0, 1, -1};
int dy[] = {-1, 1, 0, 0};
long long ex = 1021, ex2 = 1297;
long long invi[200050], invi2[200050], po[200050], po2[200050];
int hashi[3][27][200050], hashi2[3][27][200050], nwe[3][27][200050];
pair<int, int> extendedEuclid(long long a, long long b) {
  if (b == 0)
    return pair<int, int>(1, 0);
  else {
    pair<int, int> d = extendedEuclid(b, a % b);
    return pair<int, int>(d.second, d.first - d.second * (a / b));
  }
}
int modularInverse(long long a, int n) {
  pair<int, int> ret = extendedEuclid(a, n);
  return ((ret.first % n) + n) % n;
}
char str[3][200050];
void preparehash(int id, int v) {
  long long mul = ex, mul2 = ex2, g;
  for (long long i = 1; str[id][i]; i++) {
    if (str[id][i] - 96 != v)
      g = 0;
    else
      g = i;
    hashi[id][v][i] = (g * mul) % 1000000007;
    hashi2[id][v][i] = (g * mul2) % 1000000009;
    mul = (mul * ex) % 1000000007;
    mul2 = (mul2 * ex2) % 1000000009;
    if (i) hashi[id][v][i] += hashi[id][v][i - 1];
    if (i) hashi2[id][v][i] += hashi2[id][v][i - 1];
    hashi[id][v][i] %= 1000000007;
    hashi2[id][v][i] %= 1000000009;
    if (id == 0) {
      nwe[0][v][i] = (g != 0) * po[i];
      nwe[1][v][i] = (g != 0) * po2[i];
      nwe[0][v][i] += nwe[0][v][i - 1];
      nwe[1][v][i] += nwe[1][v][i - 1];
      nwe[0][v][i] %= 1000000007;
      nwe[1][v][i] %= 1000000009;
    }
  }
}
long long cal2(int id, int lo, int high, int v, int md) {
  int g;
  g = nwe[id][v][lo - 1];
  long long ret = nwe[id][v][high] - g;
  if (ret < 0) ret = (ret + md) % md;
  return (ret * (lo - 1)) % md;
}
void pre(int n) {
  po[0] = 1;
  po2[0] = 1;
  invi[0] = modularInverse(po[0], 1000000007);
  invi2[0] = modularInverse(po2[0], 1000000009);
  for (int i = 1; i <= n; i++) {
    po[i] = (po[i - 1] * ex) % 1000000007;
    po2[i] = (po2[i - 1] * ex2) % 1000000009;
    invi[i] = modularInverse(po[i], 1000000007);
    invi2[i] = modularInverse(po2[i], 1000000009);
  }
}
map<pair<long long, long long>, int> name;
pair<int, int> paku;
long long temp[28], temp2[28];
int ara[200050], cnt, vis[27];
long long cal(int kto, int kon, int indx) {
  if (kto == 1) return hashi[0][kon][indx];
  return hashi2[0][kon][indx];
}
int ase[28];
int main() {
  int i, j, k, l, m, n, lo;
  scanf("%d%d", &n, &m);
  pre(n);
  scanf("%s%s", str[0] + 1, str[1] + 1);
  for (int i = 1; str[1][i]; i++) {
    ase[str[1][i] - 96] = 1;
  }
  for (int i = 1; i <= 26; i++) {
    preparehash(0, i);
    preparehash(1, i);
  }
  for (int i = m; str[0][i]; i++) {
    lo = i - m + 1;
    memset(vis, 0, sizeof vis);
    name.clear();
    for (int j = 1; j <= 26; j++) {
      temp[j] = hashi[0][j][i] - cal(1, j, lo - 1);
      temp2[j] = hashi2[0][j][i] - cal(2, j, lo - 1);
      if (temp[j] < 0) temp[j] = (temp[j] + 1000000007) % 1000000007;
      if (temp2[j] < 0) temp2[j] = (temp2[j] + 1000000009) % 1000000009;
      temp[j] -= cal2(0, lo, i, j, 1000000007);
      temp2[j] -= cal2(1, lo, i, j, 1000000009);
      if (temp[j] < 0) temp[j] = (temp[j] + 1000000007) % 1000000007;
      if (temp2[j] < 0) temp2[j] = (temp2[j] + 1000000009) % 1000000009;
      temp[j] = (temp[j] * invi[lo - 1]) % 1000000007;
      temp2[j] = (temp2[j] * invi2[lo - 1]) % 1000000009;
      name[make_pair(temp[j], temp2[j])] = j;
    }
    for (j = 1; j <= 26; j++) {
      if (ase[j] == 0) continue;
      paku = make_pair(hashi[1][j][m], hashi2[1][j][m]);
      l = name[paku];
      if (l == 0) break;
      if (vis[j] && vis[j] != l) break;
      if (vis[j] && l == vis[j]) continue;
      k = vis[l];
      if (k && k != j) break;
      if (k == j) continue;
      vis[j] = l;
      vis[l] = j;
    }
    if (j == 27) ara[++cnt] = lo;
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) {
    printf("%d ", ara[i]);
  }
}

```