#include <bits/stdc++.h>
using namespace std;
int longestCommonPrefix(vector<string> &strs) {
  int j = 0;
  int n = strs.size();
  if (!n) return 0;
  sort(strs.begin(), strs.begin() + n);
  for (j = 0; j < strs[0].size() && j < strs[n - 1].size() &&
              strs[0][j] == strs[n - 1][j];
       j++)
    ;
  return strs[0].substr(0, j).size();
}
int main() {
  int l, r;
  bool x;
  vector<int> pos;
  string s, s_inverse, t, t_inverse;
  cin >> s >> t;
  s_inverse = s;
  t_inverse = t;
  reverse(s_inverse.begin(), s_inverse.end());
  reverse(t_inverse.begin(), t_inverse.end());
  vector<string> vec1, vec2;
  vec1.push_back(s);
  vec1.push_back(t);
  vec2.push_back(s_inverse);
  vec2.push_back(t_inverse);
  l = longestCommonPrefix(vec1);
  r = longestCommonPrefix(vec2);
  x = (l + 1 < s.size() - r);
  if (!x) {
    int n = s.size();
    int maxx = max(n - r, 1);
    int minn = min(l + 1, n);
    cout << abs(maxx - minn) + 1 << endl;
    for (int i = maxx; i <= minn; i++) {
      cout << i << " ";
    }
    cout << endl;
  } else {
    cout << "0\n";
  }
  return 0;
}
