#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int sl, tl, nxt[N], ss[N], tt[N], ans, Stack[N];
bool p[N][27], has[27];
char s[N], t[N];
int main() {
  scanf("%d %d %s %s", &sl, &tl, s + 1, t + 1);
  if (tl == 1) {
    printf("%d\n", sl);
    for (int i = 1; i <= sl; i++) printf("%d ", i);
    exit(0);
  }
  for (char x = 'a'; x <= 'z'; x++)
    for (char y = x; y <= 'z'; y++) {
      for (int i = 1; i <= sl; i++) ss[i] = s[i] == x || s[i] == y ? s[i] : 0;
      for (int i = 1; i <= tl; i++) tt[i] = t[i] == x ? y : t[i] == y ? x : 0;
      for (int i = 2; i <= tl; i++) {
        int j = nxt[i - 1];
        while (j && tt[j + 1] != tt[i]) j = nxt[j];
        if (tt[j + 1] == tt[i]) j++;
        nxt[i] = j;
      }
      for (int i = 1, j = 0; i <= sl; i++) {
        while (j && ss[i] != tt[j + 1]) j = nxt[j];
        if (ss[i] == tt[j + 1]) j++;
        if (j == tl) {
          p[i - tl + 1][x - 'a'] = 1;
          p[i - tl + 1][y - 'a'] = 1;
          j = nxt[j];
        }
      }
    }
  for (int i = 1; i <= sl - tl + 1; i++) {
    int can = 1;
    for (int j = 0; j < 26; j++) {
      if (!p[i][j]) {
        can = 0;
        break;
      }
    }
    if (can) Stack[++ans] = i;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) printf("%d ", Stack[i]);
  return 0;
}
