#include <bits/stdc++.h>
using namespace std;
vector<int> d;
string s1, s2;
int kol = 0;
void f(int uk) {
  d.push_back(uk + 1);
  while (uk - 1 >= 0 && s1[uk - 1] == s1[uk]) {
    d.push_back(uk);
    --uk;
  }
  cout << d.size() << "\n";
  reverse(d.begin(), d.end());
  for (int i = 0; i < d.size(); ++i) cout << d[i] << ' ';
}
int main() {
  cin >> s1 >> s2;
  s2 += '$';
  for (int i = 0; i < s2.length() - 1; ++i)
    if (s1[i] != s2[i] && kol == 0)
      ++kol;
    else if (s1[i + 1] != s2[i] && kol > 0)
      ++kol;
  if (s1[s1.length() - 1] != s2[s2.length() - 2]) ++kol;
  if (kol > 1) {
    cout << 0;
    return 0;
  }
  kol = 0;
  while (s1[kol] == s2[kol]) ++kol;
  f(kol);
  return 0;
}
