#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int x = 0, y = 0;
  int n = b.length();
  while (x < n && a[x] == b[x]) x++;
  while (y < n && a[n - y] == b[n - 1 - y]) y++;
  int res = x + y + 2 - (n + 1);
  res = max(0, min(res, n + 1));
  cout << res << endl;
  int start = n - y + 1;
  for (int i = 0; i < res; i++) cout << (start + i) << " ";
  cout << endl;
  return 0;
}
