#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int res = -1, pos = -1, j = 0;
  for (int i = 0; i < b.size(); i++) {
    if (a[j] != b[i]) {
      pos = j;
      if (res != -1 || a[j + 1] != b[i]) {
        res = 0;
        break;
      }
      res = 1;
      j++;
    }
    j++;
  }
  if (res == -1) res = 1, pos = a.size() - 1;
  if (res) {
    vector<int> v;
    v.push_back(pos);
    while (pos > 0 && a[--pos] == a[v[0]]) v.push_back(pos);
    cout << v.size() << endl;
    for (int i = v.size() - 1; i >= 0; i--) cout << v[i] + 1 << ' ';
    cout << endl;
  } else
    cout << 0 << endl;
  return 0;
}
