#include <bits/stdc++.h>
using namespace std;
string a, b;
int main() {
  cin >> a >> b;
  int lenb = b.length() - 1;
  int i = 0, j = lenb;
  while (a[i] == b[i]) i++;
  while (a[j + 1] == b[j]) j--;
  if (j >= i)
    cout << 0;
  else {
    cout << i - j << endl;
    for (int k = j + 1; k <= i; k++) cout << k + 1 << " ";
  }
}
