#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000000 + 7;
const long long int N = 10000000 + 6;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string st1;
  string st2;
  cin >> st1 >> st2;
  int n = st2.size();
  int l = 0, r = 0;
  for (int i = 0; i < n; i++) {
    if (st1[i] == st2[i])
      l++;
    else
      break;
  }
  for (int j = n - 1; j >= 0; j--) {
    if (st2[j] == st1[j + 1])
      r++;
    else
      break;
  }
  if (l + 1 < n + 1 - r)
    cout << 0 << endl;
  else {
    int start = max(0, n - r);
    int end = min(n, l);
    if (start > end) swap(start, end);
    cout << end - start + 1 << '\n';
    for (int i = start; i <= end; i++) cout << i + 1 << " ";
  }
  return 0;
}
