#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const long long p = 3731;
const int N = 1000000 + 3;
long long power[N];
long long h1[N], h2[N];
long long get1(int a, int b) { return h1[b] - power[b - a] * h1[a]; }
long long get2(int a, int b) { return h2[b] - power[b - a] * h2[a]; }
int main() {
  power[0] = 1;
  for (int i = 1; i < N; i++) power[i] = power[i - 1] * p;
  char s1[N], s2[N];
  scanf("%s", s1);
  scanf("%s", s2);
  h1[0] = 0;
  h2[0] = 0;
  int L = (int)strlen(s1);
  for (int i = 1; i <= L; i++) h1[i] = h1[i - 1] * p + s1[i - 1];
  for (int i = 1; i <= L - 1; i++) h2[i] = h2[i - 1] * p + s2[i - 1];
  int res = 0;
  vector<int> ans;
  if (get1(1, L) == get2(0, L - 1)) {
    res++;
    ans.push_back(1);
  }
  for (int i = 1; i < L - 1; i++) {
    if (get1(0, i) == get2(0, i) && get1(i + 1, L) == get2(i, L - 1)) {
      res++;
      ans.push_back(i + 1);
    }
  }
  if (get1(0, L - 1) == get2(0, L - 1)) {
    res++;
    ans.push_back(L);
  }
  printf("%d\n", res);
  for (int i = 0; i < (int)ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
