#include <bits/stdc++.h>
using namespace std;
string a, b;
vector<vector<bool> > d;
int p, q;
int main() {
  cin >> a >> b;
  d.resize(b.size());
  for (int i = 0; i < d.size(); i++) d[i].resize(2);
  for (int i = 0; i < d.size(); i++) {
    d[i][0] = (b[i] == a[i]);
    d[i][1] = (b[i] == a[i + 1]);
  }
  p = 0;
  q = d.size() - 1;
  for (; p < d.size() && d[p][0]; p++)
    ;
  for (; q >= 0 && d[q][1]; q--)
    ;
  if (p >= q + 1) {
    cout << p - q << "\n";
    for (int i = q + 1; i <= p; i++) cout << i + 1 << " ";
  } else
    cout << 0;
  return 0;
}
