#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int main() {
  cin >> s1 >> s2;
  int i = 0, j = 0;
  while (s1[i] == s2[j]) {
    ++i;
    ++j;
  }
  int center = i;
  ++i;
  while (s1[i] == s2[j] && (i < (int)s1.length() && j < (int)s2.length())) {
    ++i;
    ++j;
  }
  if ((i < (int)s1.length() && j < (int)s2.length()))
    cout << "0";
  else {
    int kol = 0;
    i = center;
    while (i > 0 && s1[i] == s1[center]) --i;
    if (s1[i] == s1[center])
      center = i;
    else {
      center = i + 1;
      ++i;
    }
    while (i < (int)s1.length() && s1[i] == s1[center]) {
      ++i;
      ++kol;
    }
    cout << kol << endl;
    for (int i = 0; i < kol; ++i) cout << center + i + 1 << ' ';
  }
  return 0;
}
