#include <bits/stdc++.h>
using namespace std;
void cp() {}
long long ab(long long a, long long b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
int main() {
  cp();
  long long n, m, i, j = 0, k, f = 0;
  string s, c;
  char ch;
  vector<long long> v;
  cin >> s >> c;
  n = s.size();
  m = c.size();
  for (i = 0; i < n; i++) {
    if (s[i] == c[j]) {
      j++;
    } else {
      ch = s[i];
      f = i;
      while (s[i] == s[f] && f >= 0) {
        v.push_back(f + 1);
        f--;
      }
    }
  }
  if (j < m)
    cout << "0" << endl;
  else {
    cout << v.size() << endl;
    for (i = v.size() - 1; i >= 0; i--) cout << v[i] << " ";
    cout << endl;
  }
}
