#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int maxn = 1000010;
const long long mod = 1e9 + 7;
char str1[maxn], str2[maxn];
int ans[maxn];
long long L1[maxn], R1[maxn], L2[maxn], R2[maxn];
int main() {
  while (scanf("%s", str1 + 1) != -1) {
    scanf("%s", str2 + 1);
    int len1 = strlen(str1 + 1);
    int len2 = strlen(str2 + 1);
    if (len1 - 1 != len2) {
      printf("0\n");
      continue;
    }
    L1[0] = 0;
    L2[0] = 0;
    R1[len1 + 1] = 0;
    R2[len2 + 1] = 0;
    for (int i = 1; i <= len1; i++) L1[i] = (L1[i - 1] * 26 + str1[i]) % mod;
    for (int i = len1; i >= 1; i--) R1[i] = (R1[i + 1] * 26 + str1[i]) % mod;
    for (int i = 1; i <= len2; i++) L2[i] = (L2[i - 1] * 26 + str2[i]) % mod;
    for (int i = len2; i >= 1; i--) R2[i] = (R2[i + 1] * 26 + str2[i]) % mod;
    int len = 0;
    for (int i = 1; i <= len1; i++) {
      if (L1[i - 1] == L2[i - 1] && R1[i + 1] == R2[i]) ans[len++] = i;
    }
    printf("%d\n", len);
    for (int i = 0; i < len; i++) {
      if (i == len - 1)
        printf("%d\n", ans[i]);
      else
        printf("%d ", ans[i]);
    }
  }
  return 0;
}
