#include <bits/stdc++.h>
using namespace std;
string replace(const std::string& s, char from, char to, bool f) {
  string result = s;
  for (int i = 0; i < s.length(); ++i) {
    if (result[i] != from && result[i] != to) {
      result[i] = '.';
    } else {
      if (f) {
        if (s[i] == from) {
          result[i] = to;
        } else {
          result[i] = from;
        }
      }
    }
  }
  return result;
}
vector<int> zFunction(const string& s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  string s;
  string t;
  cin >> s;
  cin >> t;
  vector<vector<pair<char, char> > > result(s.size());
  for (char from = 'a'; from <= 'z'; ++from) {
    for (char to = from; to <= 'z'; ++to) {
      string s_prep = replace(s, from, to, false);
      string t_prep = replace(t, to, from, true);
      string con = t_prep + '$' + s_prep;
      vector<int> res = zFunction(con);
      int shift = t_prep.size() + 1;
      for (int i = 0; i < s_prep.size(); ++i) {
        if (res[shift + i] == t_prep.size()) {
          result[i].push_back(make_pair(from, to));
        }
      }
    }
  }
  int letters[26];
  for (int i = 0; i < 26; ++i) {
    letters[i] = 0;
  }
  for (int i = 0; i < t.size(); ++i) {
    letters[s[i] - 'a']++;
  }
  vector<int> ans;
  for (int i = 0; i < s.size(); ++i) {
    if (i + t.size() - 1 < s.size()) {
      bool used[26];
      for (int j = 0; j < 26; ++j) {
        used[j] = false;
      }
      for (int j = 0; j < result[i].size(); ++j) {
        used[result[i][j].first - 'a'] = true;
        used[result[i][j].second - 'a'] = true;
      }
      bool f = true;
      for (int j = 0; j < 26; ++j) {
        if (!used[j] && letters[j] > 0) {
          f = false;
        }
      }
      if (f) {
        ans.push_back(i);
      }
      letters[s[i + t.size() - 1] - 'a']++;
      letters[s[i] - 'a']--;
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] + 1 << " ";
  }
  return 0;
}
