#include <bits/stdc++.h>
using namespace std;
const int size = 1000005;
char s1[size];
char s2[size];
int main() {
  int i, j, n, m, num, k;
  while (scanf("%s%s", s1, s2) == 2) {
    num = 0;
    m = strlen(s1);
    for (i = 0, j = 0; i < m; i++) {
      if (s1[i] != s2[j]) {
        num++;
        k = i;
      } else
        j++;
    }
    if (num > 1)
      printf("0\n");
    else {
      if (s1[k] != s1[k - 1]) {
        printf("1\n");
        printf("%d\n", k + 1);
      } else {
        j = k;
        while (s1[k] == s1[j] && k >= 0) k--;
        cout << j - k << endl;
        for (i = k + 1; i <= j; i++) printf("%d ", i + 1);
        cout << endl;
      }
    }
  }
  return 0;
}
