#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int mx = 26;
char s[maxn], t[maxn];
char ss[maxn], tt[maxn];
bool vis[maxn][mx];
int ans[maxn];
int nxt[maxn];
void initkmp(char p[], int m) {
  int i = 0, j = nxt[0] = -1;
  while (i < m) {
    while (j != -1 && p[i] != p[j]) j = nxt[j];
    nxt[++i] = ++j;
  }
}
void kmp(char s[], int n, char p[], int m, const char x, const char y) {
  initkmp(p, m);
  int i = 0, j = 0;
  while (i < n) {
    while (j != -1 && s[i] != p[j]) j = nxt[j];
    ++i, ++j;
    if (j >= m) {
      vis[i - m][x - 'a'] = 1;
      vis[i - m][y - 'a'] = 1;
      j = nxt[j];
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%s%s", s, t);
  for (char x = 'a'; x <= 'z'; ++x) {
    for (char y = 'a'; y <= 'z'; ++y) {
      for (int i = 0; s[i]; ++i) ss[i] = (s[i] == x || s[i] == y) ? s[i] : '0';
      for (int i = 0; t[i]; ++i)
        tt[i] = (t[i] == x) ? y : (t[i] == y ? x : '0');
      kmp(ss, n, tt, m, x, y);
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    bool ok = 1;
    for (int j = 0; j < mx; ++j) {
      if (!vis[i][j]) {
        ok = 0;
        break;
      }
    }
    if (ok) ans[cnt++] = i + 1;
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; ++i) {
    printf("%d%c", ans[i], (i == cnt - 1) ? '\n' : ' ');
  }
  return 0;
}
