#include <bits/stdc++.h>
using namespace std;
char s1[1000005], s2[1000005];
int n, wz = -1;
int main() {
  cin >> (s1 + 1) >> (s2 + 1);
  n = strlen(s1 + 1);
  for (int i = 1, j = 1; i <= n; i++, j++) {
    if (i == n && wz == -1 && s1[i] == s2[i - 1]) break;
    if (s1[i] == s2[j]) continue;
    if (wz != -1) {
      cout << 0;
      return 0;
    }
    wz = i;
    j--;
  }
  if (wz == -1) {
    cout << n << endl;
    for (int i = 1; i <= n; i++) cout << i << ' ';
    return 0;
  }
  int sum = 0, j;
  for (int i = wz; s1[i] == s1[wz]; i++) sum++;
  for (j = wz - 1; s1[j] == s1[wz]; j--) sum++;
  cout << sum << endl;
  for (++j; j < wz; j++) cout << j << ' ';
  for (int i = wz; s1[i] == s1[wz]; i++) cout << i << ' ';
  return 0;
}
