#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int k = 0, p = a.size() - 1;
  while (a[k] == b[k] && k < b.size()) k++;
  while (p - 1 >= 0 && a[p] == b[p - 1]) p--;
  if (k < p)
    cout << 0 << endl;
  else {
    cout << abs(k - p) + 1 << endl;
    for (int i = p; i <= k; i++) {
      cout << i + 1 << ' ';
    }
  }
  return 0;
}
