#include <bits/stdc++.h>
using namespace std;
string s, t;
int k = 0, p = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s >> t;
  int n = s.size(), m = t.size();
  for (int i = 0; i < m; i++)
    if (s[i] == t[i])
      k++;
    else
      break;
  for (int i = m - 1; i >= 0; i--)
    if (s[i + 1] == t[i])
      p++;
    else
      break;
  if (k + p < m)
    printf("0\n");
  else {
    printf("%d\n", k - (n - p) + 2);
    for (int i = n - p; i <= k; i++) printf("%d ", i);
    printf("%d", k + 1);
  }
  return 0;
}
