#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int N = 0;
string s, s1;
int main() {
  cin >> s >> s1;
  int n = s.length(), L = -1, R = n;
  while (L < n - 2 && s[L + 1] == s1[L + 1]) L++;
  while (R >= 2 && s[R - 1] == s1[R - 2]) R--;
  if (L + 1 < R) {
    if (L + 2 != R)
      printf("0");
    else
      printf("1\n%d", L + 2);
  } else {
    printf("%d\n", L - R + 3);
    for (auto i = R - 1; i <= L + 1; i++) printf("%d ", i + 1);
  }
}
