#include <bits/stdc++.h>
using namespace std;
bool pal(string s) {
  int i = 0, j = s.size() - 1;
  while (i <= j) {
    if (s[i] != s[j]) return false;
    i++;
    j--;
  }
  return true;
}
int main() {
  vector<int> v;
  string s, k;
  int i = 0, j = 0, l, p = 0;
  cin >> s >> k;
  int sz = s.size();
  while (i < sz && j < k.size()) {
    if (s[i] == k[j]) {
      i++;
      j++;
    } else if (p == 0) {
      p = i + 1;
      i++;
    } else {
      p = -1;
      break;
    }
  }
  if (p == 0)
    p = s.size();
  else if (p == -1) {
    cout << 0;
    return 0;
  }
  for (i = p - 1; i >= 0; i--) {
    if (s[i] == s[p - 1])
      v.push_back(i);
    else
      break;
  }
  for (i = p - 1 + 1; i < s.size(); i++) {
    if (s[i] == s[p - 1])
      v.push_back(i);
    else
      break;
  }
  cout << v.size() << endl;
  sort(v.begin(), v.end());
  for (auto g : v) cout << g + 1 << " ";
}
