#include <bits/stdc++.h>
using namespace std;
char s[1100000];
char s1[1100000];
bool pref[1100000];
bool suf[1100000];
int main() {
  gets(s);
  gets(s1);
  int n = strlen(s);
  if (n == 1) {
    printf("1\n1\n");
    return 0;
  }
  pref[0] = (s[0] == s1[0]);
  for (int i = 1; i < n - 1; i++) pref[i] = pref[i - 1] && s[i] == s1[i];
  suf[n - 1] = (s[n - 1] == s1[n - 2]);
  for (int i = n - 2; i > 0; i--) suf[i] = suf[i + 1] && (s[i] == s1[i - 1]);
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if ((i == 0 || pref[i - 1]) && (i == n - 1 || suf[i + 1])) cnt++;
  printf("%d\n", cnt);
  for (int i = 0; i < n; i++)
    if ((i == 0 || pref[i - 1]) && (i == n - 1 || suf[i + 1]))
      printf("%d ", i + 1);
  printf("\n");
  return 0;
}
