#include <bits/stdc++.h>
using namespace std;
const int N = 1000005, P = 20040911;
int ha[N], hb, p[N];
vector<int> ans;
string a, b;
int main() {
  p[0] = 1;
  for (int i = 1; i < N; i++) p[i] = p[i - 1] * P;
  cin >> a >> b;
  for (int i = 0; i < a.size(); i++) ha[i] = ha[i - 1] * P + a[i] - 'a';
  for (int i = 0; i < b.size(); i++) hb = hb * P + b[i] - 'a';
  for (int i = 0; i < a.size(); i++) {
    int k = (i == 0 ? 0 : ha[i - 1]) * p[a.size() - i - 1] + ha[a.size() - 1] -
            ha[i] * p[a.size() - i - 1];
    if (k == hb) ans.push_back(i);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i] + 1);
  return 0;
}
