#include <bits/stdc++.h>
using namespace std;
char s[1000020], t[1000020];
bool f[1000020], g[1000020];
vector<int> v;
int main(void) {
  int n;
  int i;
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (i = 1, f[0] = true, n = strlen(s + 1); i < n; i++)
    f[i] = f[i - 1] && s[i] == t[i];
  for (i = n, g[n + 1] = true; i > 1; i--) g[i] = g[i + 1] && s[i] == t[i - 1];
  for (i = 1; i <= n; i++)
    if (f[i - 1] && g[i + 1]) v.push_back(i);
  printf("%d\n", (signed)v.size());
  for (i = 0; i < (signed)v.size(); i++) printf("%d ", v.at(i));
  return 0;
}
