#include <bits/stdc++.h>
char str[2][200010];
long long power[200010], hash[2][26][200010];
int n, m, len[2], out[200010], counter[26];
long long gethash(int idx, int c, int l, int r) {
  long long h = hash[idx][c][r];
  if (l) h = h - (hash[idx][c][l - 1] * power[r - l + 1]);
  return h;
}
void generate() {
  int i, j, k, c;
  for (power[0] = 1, i = 1; i < 200010; i++)
    power[i] = power[i - 1] * 1925728309;
  memset(counter, 0, sizeof(counter));
  for (k = 0; k < 2; k++) {
    for (i = 0; i < 26; i++) {
      long long x = 0;
      for (j = 0; j < len[k]; j++) {
        if (k == 1 && i == 0) counter[str[k][j] - 97]++;
        x = (x * 1925728309) + (((str[k][j] - 97) == i) ? 1 : 0);
        hash[k][i][j] = x;
      }
    }
  }
}
int main() {
  int i, j, k, l, r;
  while (scanf("%d %d", &n, &m) != EOF) {
    scanf("%s %s", str[0], str[1]);
    len[0] = n, len[1] = m;
    generate();
    for (i = 0, l = 0; (i + m) <= n; i++) {
      r = 0;
      for (j = 0; j < 26; j++) {
        for (k = j; k < 26; k++) {
          if (gethash(0, j, i, i + m - 1) == gethash(1, k, 0, m - 1) &&
              gethash(0, k, i, i + m - 1) == gethash(1, j, 0, m - 1)) {
            r += counter[j];
            if (j != k) r += counter[k];
            break;
          }
        }
      }
      if (r == m) out[l++] = i + 1;
    }
    printf("%d\n", l);
    for (i = 0; i < l; i++) printf("%d ", out[i]);
    puts("");
  }
  return 0;
}
