#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(0);
  string s, c, s1 = "", s2 = "";
  cin >> s >> c;
  bool f = false;
  int num = -1;
  for (int i = 0; i < c.size(); i++) {
    if (s[i] != c[i] && !f) f = true, num = i;
    if (!f)
      s1 += s[i];
    else
      s1 += s[i + 1];
    s2 += s[i];
  }
  if (!f) num = s.size() - 1;
  if (s1 == c) {
    for (int i = num; i < s.size() && s[i] == s[num]; i++) ans.push_back(i + 1);
    for (int i = num - 1; i >= 0 && s[i] == s[num]; i--) ans.push_back(i + 1);
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
