#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  ifstream from;
  const int err = 0;
  const long long nmin = 1, nmax = 1000000;
  long long n, m, res, rt, i, i0, i1, j, k, ax;
  string s, st, ss, sb;
  if (0) from.open("test.txt");
  cin >> ss;
  cin >> s;
  n = s.length();
  i0 = n;
  i1 = 0;
  for (i = 0; i < n; i++) {
    if (s[i] != ss[i]) break;
    i1++;
  }
  for (i = n; i > 0; i--) {
    if (s[i - 1] != ss[i]) break;
    i0--;
  }
  res = (i0 <= i1) ? (i1 - i0 + 1) : 0;
  cout << res << endl;
  if (res > 0) {
    for (i = i0; i < i1; i++) cout << (i + 1) << ' ';
    cout << (i1 + 1) << endl;
  }
  return 0;
}
