#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename first>
inline first abs(const first& a) {
  return a < 0 ? -a : a;
}
template <typename first>
inline first sqr(const first& a) {
  return a * a;
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
const int INF = 1000 * 1000 * 1000;
const int N = 1000 * 1000 + 13;
string s1, s2;
long long h[N];
long long deg[N];
int main() {
  deg[0] = 1;
  for (int i = 1; i <= int(N - 1); i++) deg[i] = deg[i - 1] * 1009LL;
  cin >> s1 >> s2;
  long long h2 = 0;
  for (int i = 0; i < int(int((s2).size())); i++) h2 = h2 + s2[i] * deg[i];
  h2 *= 1009LL;
  h[0] = s1[0];
  for (int i = 1; i <= int(int((s1).size()) - 1); i++)
    h[i] = h[i - 1] + s1[i] * deg[i];
  vector<int> ans;
  for (int i = 0; i < int(int((s1).size())); i++) {
    long long curh = h[int((s1).size()) - 1];
    curh -= h[i];
    curh += (i == 0 ? 0 : h[i - 1] * 1009LL);
    if (curh == h2) ans.push_back(i);
  }
  cout << int((ans).size()) << endl;
  for (int i = 0; i < int(int((ans).size())); i++) printf("%d ", ans[i] + 1);
  cout << endl;
  return 0;
}
