#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
inline void amax(T &a, const T &b) {
  if (a < b) a = b;
}
vector<int> Z_Algorithm(const string &s) {
  int n = s.size();
  vector<int> z(n);
  int l = 0, r = 0;
  for (int i = 1; i < n; i++) {
    if (i > r) {
      l = r = i;
      while (r < n && s[r - l] == s[r]) r++;
      z[i] = r - l;
      r--;
    } else {
      int k = i - l;
      if (z[k] < r - i + 1)
        z[i] = z[k];
      else {
        l = i;
        while (r < n && s[r - l] == s[r]) r++;
        z[i] = r - l;
        r--;
      }
    }
  }
  return z;
}
char buf[200011];
int B[200011][26];
char C[200011][26];
bool T_h[26];
int main() {
  scanf("%*d%*d");
  scanf("%s", buf);
  string S(buf);
  scanf("%s", buf);
  string T(buf);
  for (int i = 0, i_len = (T.size()); i < i_len; ++i) T_h[T[i] - 'a'] = true;
  int TS = T.size();
  string X(T.size() + 1 + S.size(), '$');
  for (int a = 0, a_len = (26); a < a_len; ++a)
    for (int b = 0, b_len = (26); b < b_len; ++b) {
      for (int i = 0, i_len = (T.size()); i < i_len; ++i) {
        if (T[i] - 'a' == a)
          X[i] = 'a';
        else
          X[i] = 'b';
      }
      for (int i = 0, i_len = (S.size()); i < i_len; ++i) {
        if (S[i] - 'a' == b)
          X[TS + 1 + i] = 'a';
        else
          X[TS + 1 + i] = 'b';
      }
      vector<int> z = Z_Algorithm(X);
      if (!T_h[a]) {
        for (int i = 0, i_len = (S.size()); i < i_len; ++i) {
          if (z[i + TS + 1] == TS) {
            B[i][a] |= 1 << b;
          }
        }
      } else {
        for (int i = 0, i_len = (S.size()); i < i_len; ++i) {
          if (z[i + TS + 1] == TS) {
            C[i][a] = b + 'a';
          }
        }
      }
    }
  vector<int> ans;
  for (int i = 0, i_len = (S.size() - T.size() + 1); i < i_len; ++i) {
    bool ok = true;
    int cnt = 0;
    set<char> se[26];
    for (int a = 0, a_len = (26); a < a_len; ++a) {
      if (T_h[a]) {
        cnt++;
        if (!C[i][a]) {
          ok = false;
          break;
        }
        int b = C[i][a] - 'a';
        if (C[i][b] == a + 'a' || (C[i][b] == 0 && B[i][b] & (1 << a))) {
          se[a].insert(b + 'a');
          se[b].insert(a + 'a');
        } else {
          ok = false;
          break;
        }
      }
    }
    if (cnt && ok) {
      for (int a = 0, a_len = (26); a < a_len; ++a)
        if (se[a].size() > 1u) ok = false;
      if (ok) ans.push_back(i + 1);
    }
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0, i_len = (ans.size()); i < i_len; ++i) {
    printf("%d%c", ans[i], i + 1 == i_len ? '\n' : ' ');
  }
  return 0;
}
