#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, b;
  cin >> a >> b;
  long long n = a.length();
  a = '+' + a;
  b = '-' + b;
  for (int i = 1; i <= n; i++) {
    if (a[i] != b[i]) {
      int check = 0;
      for (int x = i + 1; x <= n; x++) {
        if (a[x] != b[x - 1]) check = 1;
      }
      if (check == 1)
        cout << "0" << endl;
      else {
        long long dem = 0, k = i;
        while (a[k] == a[i]) {
          dem++;
          k--;
        }
        cout << dem << endl;
        for (int j = k + 1; j <= i; j++) cout << j << " ";
      }
      break;
    }
  }
}
