#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int l1 = s1.length();
  int l2 = s2.length();
  int ind = -1;
  for (int i = 0; i < l2; i++) {
    if (s1[i] != s2[i]) {
      ind = i;
      break;
    }
  }
  if (ind == -1) {
    int i = l2;
    set<int> s;
    s.insert(l2);
    while (i > 0) {
      if (s1[i] == s1[i - 1]) {
        s.insert(i - 1);
        i--;
      } else {
        break;
      }
    }
    cout << s.size() << endl;
    for (set<int>::iterator it = s.begin(); it != s.end(); it++)
      cout << *it + 1 << " ";
    return 0;
  }
  for (int i = ind; i < l2; i++) {
    if (s1[i + 1] != s2[i]) {
      cout << 0;
      return 0;
    }
  }
  int i = ind;
  int count = 0;
  set<int> s;
  s.insert(i);
  while (i > 0) {
    if (s1[i - 1] == s1[i]) {
      count++;
      s.insert(i - 1);
      i--;
    } else {
      break;
    }
  }
  while (i < l2) {
    if (s1[i] == s1[i + 1]) {
      count++;
      s.insert(i + 1);
      i++;
    } else {
      break;
    }
  }
  cout << s.size() << endl;
  for (set<int>::iterator it = s.begin(); it != s.end(); it++)
    cout << *it + 1 << " ";
}
