#include <bits/stdc++.h>
using namespace std;
char s1[1000010], s2[1000010];
int nxt[1000010], fro[1000010], bac[1000010], len1, len2;
int pos[1000010], cnt;
int read() {
  static int res;
  static char op;
  do op = getchar();
  while (op > '9' || op < '0');
  for (res = 0; op >= '0' && op <= '9'; op = getchar())
    res = res * 10 + (op ^ 48);
  return res;
}
signed main(int argc, char **argv) {
  scanf("%s\n%s", s1 + 1, s2 + 1);
  len1 = strlen(s1 + 1), len2 = len1 - 1;
  for (int i = 2, j = 0; i <= len2; ++i) {
    while (j && s2[j + 1] != s2[i]) j = nxt[j];
    if (s2[j + 1] == s2[i]) ++j;
    nxt[i] = j;
  }
  for (int i = 1, j = 0; i <= len1; ++i) {
    while (j && s2[j + 1] != s1[i]) j = nxt[j];
    if (s2[j + 1] == s1[i]) ++j;
    fro[i] = j;
  }
  memset(nxt, 0, sizeof nxt);
  nxt[len2] = len1;
  for (int i = len2 - 1, j = len2 + 1; i; --i) {
    while (j < len2 && s2[j - 1] != s2[i]) j = nxt[j];
    if (s2[j - 1] == s2[i]) --j;
    nxt[i] = j;
  }
  for (int i = len1, j = len1; i; --i) {
    while (j < len2 && s2[j - 1] != s1[i]) j = nxt[j];
    if (s2[j - 1] == s1[i]) --j;
    bac[i] = len2 - j + 1;
  }
  for (int i = 1; i <= len1; ++i)
    if (fro[i - 1] + bac[i + 1] == len2) pos[++cnt] = i;
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; ++i) printf("%d ", pos[i]);
  return 0;
}
