#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1;
bool ok[N];
vector<int> v;
int main() {
  string a, b;
  cin >> a >> b;
  for (int i = a.size() - 1; i > 0; i--) {
    if (a[i] == b[i - 1])
      ok[i - 1] = true;
    else
      break;
  }
  for (int i = 0; i < b.size(); i++) {
    if (ok[i]) v.push_back(i);
    if (a[i] != b[i]) break;
  }
  bool all = true;
  for (int i = 0; i < b.size(); i++)
    if (a[i] != b[i]) all = false;
  if (all) v.push_back(a.size() - 1);
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] + 1 << ' ';
}
