#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, m, f[N], f2[N], a[N], b[N];
bool match[N][27][27];
string s, t;
vector<int> ans;
void KMP(int x, int y) {
  for (int i = 0; i < n; i++) {
    f[i] = 0;
    f2[i] = 0;
    if (s[i] == x) {
      a[i] = 1;
    } else {
      a[i] = 0;
    }
  }
  for (int i = 0; i < m; i++) {
    if (t[i] == y) {
      b[i] = 1;
    } else {
      b[i] = 0;
    }
  }
  b[m] = 2019;
  long long curr = 0;
  for (int i = 2; i <= m; i++) {
    while (curr > 0 && b[i - 1] != b[curr]) {
      curr = f2[curr];
    }
    if (b[i - 1] == b[curr]) curr++;
    f2[i] = curr;
  }
  curr = 0;
  for (int i = 2; i <= n; i++) {
    while (curr > 0 && a[i - 1] != b[curr]) {
      curr = f2[curr];
    }
    if (a[i - 1] == b[curr]) curr++;
    f[i] = curr;
    if (curr == m) {
      match[i][x][y] = true;
    }
  }
  bool tmp = true;
  for (int i = 0; i < m; i++) {
    if (a[i] != b[i]) {
      tmp = false;
    }
  }
  if (tmp) {
    match[m][x][y] = true;
  }
}
bool check(int p) {
  for (int i = 'a'; i <= 'z'; i++) {
    for (int j = 'a'; j <= 'z'; j++) {
      if (match[p][i][j] && match[p][j][i]) {
        break;
      }
      if (j == 'z') {
        return false;
      }
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> s >> t;
  for (int i = 'a'; i <= 'z'; i++) {
    for (int j = 'a'; j <= 'z'; j++) {
      KMP(i, j);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (check(i)) {
      ans.push_back(i - m + 1);
    }
  }
  cout << ans.size() << endl;
  for (auto x : ans) {
    cout << x << " ";
  }
  return 0;
}
