#include <bits/stdc++.h>
int prefix_length(char a[], char b[]) {
  int i = 1;
  while (a[i] == b[i]) ++i;
  return i - 1;
}
int suffix_length(char a[], char b[], int len) {
  int i = len;
  while (i >= 2 && a[i] == b[i - 1]) i--;
  return len - i;
}
int main() {
  static char a[(int)1e6 + 2], b[(int)1e6 + 2];
  gets(&a[1]);
  gets(&b[1]);
  int len = strlen(&a[1]);
  int prefix = prefix_length(a, b);
  int suffix = suffix_length(a, b, len);
  int total = (prefix + 1) - (len - suffix) + 1;
  if (total < 0) total = 0;
  printf("%d\n", total);
  for (int i = 0; i < total; ++i) {
    printf("%d", i + len - suffix);
    if (i + 1 < total)
      printf(" ");
    else
      printf("\n");
  }
}
