#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct Z_p {
  using Type = typename decay<decltype(T::value)>::type;
  static vector<Type> MOD_INV;
  constexpr Z_p() : value() {}
  template <typename U>
  Z_p(const U &x) {
    value = normalize(x);
  }
  template <typename U>
  static Type normalize(const U &x) {
    Type v;
    if (-mod() <= x && x < mod())
      v = static_cast<Type>(x);
    else
      v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }
  const Type &operator()() const { return value; }
  template <typename U>
  explicit operator U() const {
    return static_cast<U>(value);
  }
  constexpr static Type mod() { return T::value; }
  Z_p &operator+=(const Z_p &otr) {
    if ((value += otr.value) >= mod()) value -= mod();
    return *this;
  }
  Z_p &operator-=(const Z_p &otr) {
    if ((value -= otr.value) < 0) value += mod();
    return *this;
  }
  template <typename U>
  Z_p &operator+=(const U &otr) {
    return *this += Z_p(otr);
  }
  template <typename U>
  Z_p &operator-=(const U &otr) {
    return *this -= Z_p(otr);
  }
  Z_p &operator++() { return *this += 1; }
  Z_p &operator--() { return *this -= 1; }
  Z_p operator++(int) {
    Z_p result(*this);
    *this += 1;
    return result;
  }
  Z_p operator--(int) {
    Z_p result(*this);
    *this -= 1;
    return result;
  }
  Z_p operator-() const { return Z_p(-value); }
  template <typename U = T>
  typename enable_if<is_same<typename Z_p<U>::Type, int>::value, Z_p>::type &
  operator*=(const Z_p &rhs) {
    value = normalize(static_cast<int64_t>(value) *
                      static_cast<int64_t>(rhs.value));
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Z_p<U>::Type, int64_t>::value, Z_p>::type
      &
      operator*=(const Z_p &rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) *
                                     rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Z_p<U>::Type>::value, Z_p>::type &
  operator*=(const Z_p &rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }
  Z_p &operator^=(long long e) {
    if (e < 0) *this = 1 / *this, e = -e;
    Z_p res = 1;
    for (; e; *this *= *this, e >>= 1)
      if (e & 1) res *= *this;
    return *this = res;
  }
  Z_p operator^(long long e) const { return Z_p(*this) ^= e; }
  Z_p &operator/=(const Z_p &otr) {
    Type a = otr.value, m = mod(), u = 0, v = 1;
    if (a < (int)MOD_INV.size()) return *this *= MOD_INV[a];
    while (a) {
      Type t = m / a;
      m -= t * a;
      swap(a, m);
      u -= t * v;
      swap(u, v);
    }
    assert(m == 1);
    return *this *= u;
  }
  template <typename U>
  friend const Z_p<U> &abs(const Z_p<U> &v) {
    return v;
  }
  Type value;
};
template <typename T>
bool operator==(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value == rhs.value;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator==(const Z_p<T> &lhs, U rhs) {
  return lhs == Z_p<T>(rhs);
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator==(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) == rhs;
}
template <typename T>
bool operator!=(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator!=(const Z_p<T> &lhs, U rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator!=(U lhs, const Z_p<T> &rhs) {
  return !(lhs == rhs);
}
template <typename T>
bool operator<(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value < rhs.value;
}
template <typename T>
bool operator>(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value > rhs.value;
}
template <typename T>
bool operator<=(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value <= rhs.value;
}
template <typename T>
bool operator>=(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value >= rhs.value;
}
template <typename T>
Z_p<T> operator+(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) += rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator+(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) += rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator+(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) += rhs;
}
template <typename T>
Z_p<T> operator-(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) -= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator-(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) -= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator-(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) -= rhs;
}
template <typename T>
Z_p<T> operator*(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) *= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator*(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) *= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator*(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) *= rhs;
}
template <typename T>
Z_p<T> operator/(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) /= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator/(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) /= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator/(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) /= rhs;
}
template <typename T>
istream &operator>>(istream &in, Z_p<T> &number) {
  typename common_type<typename Z_p<T>::Type, int64_t>::type x;
  in >> x;
  number.value = Z_p<T>::normalize(x);
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, const Z_p<T> &number) {
  return out << number();
}
constexpr int mod = 1e9 + 7;
using Zp = Z_p<integral_constant<decay<decltype(mod)>::type, mod>>;
template <typename T>
vector<typename Z_p<T>::Type> Z_p<T>::MOD_INV;
template <typename T = integral_constant<decay<decltype(mod)>::type, mod>>
void precalc_inverse(int SZ) {
  auto &inv = Z_p<T>::MOD_INV;
  if (inv.empty()) inv.assign(2, 1);
  for (; inv.size() <= SZ;)
    inv.push_back(
        (mod - 1LL * mod / (int)inv.size() * inv[mod % (int)inv.size()]) % mod);
}
template <typename T>
vector<T> precalc_power(T base, int SZ) {
  vector<T> res(SZ + 1, 1);
  for (int i = 1; i <= SZ; ++i) res[i] = res[i - 1] * base;
  return res;
}
using namespace chrono;
mt19937 rng(high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rngll(high_resolution_clock::now().time_since_epoch().count());
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(ios::badbit | ios::failbit);
  Zp base = rng() % int(1e9) + 10000;
  auto pow = precalc_power(base, 200009);
  int n, m;
  string s, t;
  cin >> n >> m >> s >> t;
  vector<array<int, 26>> ok(n - m + 1);
  array<vector<int>, 26> cpos;
  array<vector<int>, 26> dpos;
  for (auto c = 0; c < 26; ++c) {
    for (auto i = 0; i < n; ++i) {
      if (s[i] - 'a' == c) {
        cpos[c].push_back(i);
      }
    }
    for (auto i = 0; i < m; ++i) {
      if (t[i] - 'a' == c) {
        dpos[c].push_back(i);
      }
    }
  }
  for (auto c = 0; c < 26; ++c) {
    for (auto d = 0; d < 26; ++d) {
      static vector<int> a(n), b(m);
      for (auto i : cpos[c]) {
        a[i] = true;
      }
      for (auto i : dpos[d]) {
        b[i] = true;
      }
      Zp ahash = 0, bhash = 0;
      for (auto i = 0; i < m - 1; ++i) {
        ahash = ahash * base + a[i];
      }
      for (auto i = 0; i < m; ++i) {
        bhash = bhash * base + b[i];
      }
      for (auto i = 0; i <= n - m; ++i) {
        ahash = ahash * base + a[i + m - 1];
        if (ahash == bhash) {
          ok[i][c] |= 1 << d;
        }
        ahash -= pow[m - 1] * a[i];
      }
      for (auto i : cpos[c]) {
        a[i] = false;
      }
      for (auto i : dpos[d]) {
        b[i] = false;
      }
    }
  }
  vector<int> res;
  for (auto i = 0; i <= n - m; ++i) {
    for (auto c = 0; c < 26; ++c) {
      for (auto d = 0; d < 26; ++d) {
        if (ok[i][c] & 1 << d && ok[i][d] & 1 << c) {
          goto OK;
        }
      }
      goto FAIL;
    OK:;
    }
    res.push_back(i);
  FAIL:;
  }
  cout << (int)res.size() << "\n";
  for (auto i : res) {
    cout << i + 1 << " ";
  }
  cout << "\n";
  return 0;
}

### Prompt

Your challenge is to write a Cpp solution to the following problem:

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 T>
struct Z_p {
  using Type = typename decay<decltype(T::value)>::type;
  static vector<Type> MOD_INV;
  constexpr Z_p() : value() {}
  template <typename U>
  Z_p(const U &x) {
    value = normalize(x);
  }
  template <typename U>
  static Type normalize(const U &x) {
    Type v;
    if (-mod() <= x && x < mod())
      v = static_cast<Type>(x);
    else
      v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }
  const Type &operator()() const { return value; }
  template <typename U>
  explicit operator U() const {
    return static_cast<U>(value);
  }
  constexpr static Type mod() { return T::value; }
  Z_p &operator+=(const Z_p &otr) {
    if ((value += otr.value) >= mod()) value -= mod();
    return *this;
  }
  Z_p &operator-=(const Z_p &otr) {
    if ((value -= otr.value) < 0) value += mod();
    return *this;
  }
  template <typename U>
  Z_p &operator+=(const U &otr) {
    return *this += Z_p(otr);
  }
  template <typename U>
  Z_p &operator-=(const U &otr) {
    return *this -= Z_p(otr);
  }
  Z_p &operator++() { return *this += 1; }
  Z_p &operator--() { return *this -= 1; }
  Z_p operator++(int) {
    Z_p result(*this);
    *this += 1;
    return result;
  }
  Z_p operator--(int) {
    Z_p result(*this);
    *this -= 1;
    return result;
  }
  Z_p operator-() const { return Z_p(-value); }
  template <typename U = T>
  typename enable_if<is_same<typename Z_p<U>::Type, int>::value, Z_p>::type &
  operator*=(const Z_p &rhs) {
    value = normalize(static_cast<int64_t>(value) *
                      static_cast<int64_t>(rhs.value));
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Z_p<U>::Type, int64_t>::value, Z_p>::type
      &
      operator*=(const Z_p &rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) *
                                     rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Z_p<U>::Type>::value, Z_p>::type &
  operator*=(const Z_p &rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }
  Z_p &operator^=(long long e) {
    if (e < 0) *this = 1 / *this, e = -e;
    Z_p res = 1;
    for (; e; *this *= *this, e >>= 1)
      if (e & 1) res *= *this;
    return *this = res;
  }
  Z_p operator^(long long e) const { return Z_p(*this) ^= e; }
  Z_p &operator/=(const Z_p &otr) {
    Type a = otr.value, m = mod(), u = 0, v = 1;
    if (a < (int)MOD_INV.size()) return *this *= MOD_INV[a];
    while (a) {
      Type t = m / a;
      m -= t * a;
      swap(a, m);
      u -= t * v;
      swap(u, v);
    }
    assert(m == 1);
    return *this *= u;
  }
  template <typename U>
  friend const Z_p<U> &abs(const Z_p<U> &v) {
    return v;
  }
  Type value;
};
template <typename T>
bool operator==(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value == rhs.value;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator==(const Z_p<T> &lhs, U rhs) {
  return lhs == Z_p<T>(rhs);
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator==(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) == rhs;
}
template <typename T>
bool operator!=(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator!=(const Z_p<T> &lhs, U rhs) {
  return !(lhs == rhs);
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
bool operator!=(U lhs, const Z_p<T> &rhs) {
  return !(lhs == rhs);
}
template <typename T>
bool operator<(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value < rhs.value;
}
template <typename T>
bool operator>(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value > rhs.value;
}
template <typename T>
bool operator<=(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value <= rhs.value;
}
template <typename T>
bool operator>=(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return lhs.value >= rhs.value;
}
template <typename T>
Z_p<T> operator+(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) += rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator+(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) += rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator+(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) += rhs;
}
template <typename T>
Z_p<T> operator-(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) -= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator-(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) -= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator-(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) -= rhs;
}
template <typename T>
Z_p<T> operator*(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) *= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator*(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) *= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator*(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) *= rhs;
}
template <typename T>
Z_p<T> operator/(const Z_p<T> &lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) /= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator/(const Z_p<T> &lhs, U rhs) {
  return Z_p<T>(lhs) /= rhs;
}
template <typename T, typename U,
          typename enable_if<is_integral<U>::value>::type * = nullptr>
Z_p<T> operator/(U lhs, const Z_p<T> &rhs) {
  return Z_p<T>(lhs) /= rhs;
}
template <typename T>
istream &operator>>(istream &in, Z_p<T> &number) {
  typename common_type<typename Z_p<T>::Type, int64_t>::type x;
  in >> x;
  number.value = Z_p<T>::normalize(x);
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, const Z_p<T> &number) {
  return out << number();
}
constexpr int mod = 1e9 + 7;
using Zp = Z_p<integral_constant<decay<decltype(mod)>::type, mod>>;
template <typename T>
vector<typename Z_p<T>::Type> Z_p<T>::MOD_INV;
template <typename T = integral_constant<decay<decltype(mod)>::type, mod>>
void precalc_inverse(int SZ) {
  auto &inv = Z_p<T>::MOD_INV;
  if (inv.empty()) inv.assign(2, 1);
  for (; inv.size() <= SZ;)
    inv.push_back(
        (mod - 1LL * mod / (int)inv.size() * inv[mod % (int)inv.size()]) % mod);
}
template <typename T>
vector<T> precalc_power(T base, int SZ) {
  vector<T> res(SZ + 1, 1);
  for (int i = 1; i <= SZ; ++i) res[i] = res[i - 1] * base;
  return res;
}
using namespace chrono;
mt19937 rng(high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rngll(high_resolution_clock::now().time_since_epoch().count());
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(ios::badbit | ios::failbit);
  Zp base = rng() % int(1e9) + 10000;
  auto pow = precalc_power(base, 200009);
  int n, m;
  string s, t;
  cin >> n >> m >> s >> t;
  vector<array<int, 26>> ok(n - m + 1);
  array<vector<int>, 26> cpos;
  array<vector<int>, 26> dpos;
  for (auto c = 0; c < 26; ++c) {
    for (auto i = 0; i < n; ++i) {
      if (s[i] - 'a' == c) {
        cpos[c].push_back(i);
      }
    }
    for (auto i = 0; i < m; ++i) {
      if (t[i] - 'a' == c) {
        dpos[c].push_back(i);
      }
    }
  }
  for (auto c = 0; c < 26; ++c) {
    for (auto d = 0; d < 26; ++d) {
      static vector<int> a(n), b(m);
      for (auto i : cpos[c]) {
        a[i] = true;
      }
      for (auto i : dpos[d]) {
        b[i] = true;
      }
      Zp ahash = 0, bhash = 0;
      for (auto i = 0; i < m - 1; ++i) {
        ahash = ahash * base + a[i];
      }
      for (auto i = 0; i < m; ++i) {
        bhash = bhash * base + b[i];
      }
      for (auto i = 0; i <= n - m; ++i) {
        ahash = ahash * base + a[i + m - 1];
        if (ahash == bhash) {
          ok[i][c] |= 1 << d;
        }
        ahash -= pow[m - 1] * a[i];
      }
      for (auto i : cpos[c]) {
        a[i] = false;
      }
      for (auto i : dpos[d]) {
        b[i] = false;
      }
    }
  }
  vector<int> res;
  for (auto i = 0; i <= n - m; ++i) {
    for (auto c = 0; c < 26; ++c) {
      for (auto d = 0; d < 26; ++d) {
        if (ok[i][c] & 1 << d && ok[i][d] & 1 << c) {
          goto OK;
        }
      }
      goto FAIL;
    OK:;
    }
    res.push_back(i);
  FAIL:;
  }
  cout << (int)res.size() << "\n";
  for (auto i : res) {
    cout << i + 1 << " ";
  }
  cout << "\n";
  return 0;
}

```