#include <bits/stdc++.h>
using namespace std;
template <typename Int, Int mod>
class ModInt {
 public:
  static const Int Mod = mod;
  Int first;
  ModInt() : first(0) {}
  ModInt(int a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  ModInt(long long a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  Int get() const { return first; }
  ModInt &operator+=(ModInt that) {
    if ((first += that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator-=(ModInt that) {
    if ((first += mod - that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator*=(ModInt that) {
    first = (long long)(first)*that.first % mod;
    return *this;
  }
  bool operator==(ModInt that) const { return first == that.first; }
  ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
  ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
  ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
  ModInt operator-() const { return ModInt(-this->first); }
  inline friend ostream &operator<<(ostream &out, ModInt m) {
    return out << m.first;
  }
  ModInt power(long long k) const {
    ModInt r(1);
    ModInt b = *this;
    if (k <= 0) return r;
    while (k) {
      if (k & 1) r *= b;
      b *= b;
      k >>= 1;
    }
    return r;
  }
  ModInt inverse() const {
    long long a = first, b = mod, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return ModInt(u);
  }
  bool operator<(const ModInt &o) const { return first < o.first; }
};
int NT, NS;
char S[(200005)], T[(200005)];
const int P1 = 1000000007;
const int P2 = 1000000009;
const int m1 = 2;
const int m2 = 3;
const pair<ModInt<int, P1>, ModInt<int, P2> > HASH_ZERO;
void add(pair<ModInt<int, P1>, ModInt<int, P2> > &h, int v) {
  h.first = h.first * m1 + v;
  h.second = h.second * m2 + v;
}
vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > get_code(
    pair<ModInt<int, P1>, ModInt<int, P2> > h[26]) {
  vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > ret;
  for (int(i) = 0; (i) < (26); ++(i)) {
    if (h[i] != HASH_ZERO) {
      ret.push_back(make_pair(h[i], i));
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}
bool equal_(vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > &a,
            vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > &b) {
  if (((int)((a).size())) != ((int)((b).size()))) return false;
  for (int(i) = 0; (i) < (((int)((a).size()))); ++(i)) {
    if (a[i].first != b[i].first) return false;
  }
  return true;
}
int main() {
  scanf("%d %d", &NS, &NT);
  scanf("%s %s", S, T);
  ModInt<int, P1> head1 = ModInt<int, P1>(m1).power(NT);
  ModInt<int, P2> head2 = ModInt<int, P2>(m2).power(NT);
  pair<ModInt<int, P1>, ModInt<int, P2> > temp_S[26], temp_T[26];
  for (int(i) = 0; (i) < (26); ++(i)) {
    for (int(j) = 0; (j) < (NT); ++(j)) add(temp_T[i], i + 'a' == T[j]);
    for (int(j) = 0; (j) < (NT); ++(j)) add(temp_S[i], i + 'a' == S[j]);
  }
  vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > t_code =
      get_code(temp_T);
  int SZ_t_code = ((int)((t_code).size()));
  vector<int> ans;
  for (int(i) = 0; (i) < (NS - NT + 1); ++(i)) {
    if (i) {
      for (int(j) = 0; (j) < (26); ++(j))
        add(temp_S[j], j + 'a' == S[i + NT - 1]);
      temp_S[S[i - 1] - 'a'].first -= head1;
      temp_S[S[i - 1] - 'a'].second -= head2;
    }
    vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > s_code =
        get_code(temp_S);
    if (equal_(t_code, s_code)) {
      int used[26];
      memset(used, -1, sizeof(used));
      bool good = true;
      for (int(j) = 0; (j) < (SZ_t_code); ++(j)) {
        int cs = s_code[j].second;
        int ct = t_code[j].second;
        if (used[cs] == -1) {
          if (used[ct] != -1 && used[ct] != cs) {
            good = false;
            break;
          }
          used[cs] = ct;
          used[ct] = cs;
        } else {
          if (used[cs] != ct) {
            good = false;
            break;
          }
        }
      }
      if (good) ans.push_back(i + 1);
    }
  }
  cout << ((int)((ans).size())) << endl;
  for (int a : ans) cout << a << " ";
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

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 <typename Int, Int mod>
class ModInt {
 public:
  static const Int Mod = mod;
  Int first;
  ModInt() : first(0) {}
  ModInt(int a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  ModInt(long long a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  Int get() const { return first; }
  ModInt &operator+=(ModInt that) {
    if ((first += that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator-=(ModInt that) {
    if ((first += mod - that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator*=(ModInt that) {
    first = (long long)(first)*that.first % mod;
    return *this;
  }
  bool operator==(ModInt that) const { return first == that.first; }
  ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
  ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
  ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
  ModInt operator-() const { return ModInt(-this->first); }
  inline friend ostream &operator<<(ostream &out, ModInt m) {
    return out << m.first;
  }
  ModInt power(long long k) const {
    ModInt r(1);
    ModInt b = *this;
    if (k <= 0) return r;
    while (k) {
      if (k & 1) r *= b;
      b *= b;
      k >>= 1;
    }
    return r;
  }
  ModInt inverse() const {
    long long a = first, b = mod, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return ModInt(u);
  }
  bool operator<(const ModInt &o) const { return first < o.first; }
};
int NT, NS;
char S[(200005)], T[(200005)];
const int P1 = 1000000007;
const int P2 = 1000000009;
const int m1 = 2;
const int m2 = 3;
const pair<ModInt<int, P1>, ModInt<int, P2> > HASH_ZERO;
void add(pair<ModInt<int, P1>, ModInt<int, P2> > &h, int v) {
  h.first = h.first * m1 + v;
  h.second = h.second * m2 + v;
}
vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > get_code(
    pair<ModInt<int, P1>, ModInt<int, P2> > h[26]) {
  vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > ret;
  for (int(i) = 0; (i) < (26); ++(i)) {
    if (h[i] != HASH_ZERO) {
      ret.push_back(make_pair(h[i], i));
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}
bool equal_(vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > &a,
            vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > &b) {
  if (((int)((a).size())) != ((int)((b).size()))) return false;
  for (int(i) = 0; (i) < (((int)((a).size()))); ++(i)) {
    if (a[i].first != b[i].first) return false;
  }
  return true;
}
int main() {
  scanf("%d %d", &NS, &NT);
  scanf("%s %s", S, T);
  ModInt<int, P1> head1 = ModInt<int, P1>(m1).power(NT);
  ModInt<int, P2> head2 = ModInt<int, P2>(m2).power(NT);
  pair<ModInt<int, P1>, ModInt<int, P2> > temp_S[26], temp_T[26];
  for (int(i) = 0; (i) < (26); ++(i)) {
    for (int(j) = 0; (j) < (NT); ++(j)) add(temp_T[i], i + 'a' == T[j]);
    for (int(j) = 0; (j) < (NT); ++(j)) add(temp_S[i], i + 'a' == S[j]);
  }
  vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > t_code =
      get_code(temp_T);
  int SZ_t_code = ((int)((t_code).size()));
  vector<int> ans;
  for (int(i) = 0; (i) < (NS - NT + 1); ++(i)) {
    if (i) {
      for (int(j) = 0; (j) < (26); ++(j))
        add(temp_S[j], j + 'a' == S[i + NT - 1]);
      temp_S[S[i - 1] - 'a'].first -= head1;
      temp_S[S[i - 1] - 'a'].second -= head2;
    }
    vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > s_code =
        get_code(temp_S);
    if (equal_(t_code, s_code)) {
      int used[26];
      memset(used, -1, sizeof(used));
      bool good = true;
      for (int(j) = 0; (j) < (SZ_t_code); ++(j)) {
        int cs = s_code[j].second;
        int ct = t_code[j].second;
        if (used[cs] == -1) {
          if (used[ct] != -1 && used[ct] != cs) {
            good = false;
            break;
          }
          used[cs] = ct;
          used[ct] = cs;
        } else {
          if (used[cs] != ct) {
            good = false;
            break;
          }
        }
      }
      if (good) ans.push_back(i + 1);
    }
  }
  cout << ((int)((ans).size())) << endl;
  for (int a : ans) cout << a << " ";
  return 0;
}

```