#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  cin >> s;
  cin >> s1;
  vector<int> ans;
  int o = -1;
  for (int i = 0; i < s1.size(); i++) {
    if (s[i] != s1[i]) {
      o = i;
      break;
    }
  }
  if (o == -1) o = s.size() - 1;
  for (int i = o + 1; i < s.size(); i++)
    if (s[i] != s1[i - 1]) {
      cout << 0 << endl;
      return 0;
    }
  ans.push_back(o);
  int O_o = o;
  o--;
  while (o >= 0 && s[o] == s[O_o]) {
    ans.push_back(o);
    o--;
  }
  cout << ans.size() << endl;
  for (int i = ans.size() - 1; i >= 0; i--) cout << ans[i] + 1 << " ";
  return 0;
}
