#include <bits/stdc++.h>
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T lcm(T a, T b) {
  return a / __gcd(a, b) * b;
}
template <class T>
T minimize(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
T maximize(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
const long long mod = 1e9 + 7, N = 1e6 + 6;
char str[2][N];
long long n, m;
long long H[4][N];
void Inp() {
  scanf("%s", str[0] + 1);
  scanf("%s", str[1] + 1);
  n = strlen(str[0] + 1);
  m = strlen(str[1] + 1);
}
void Hash_build() {
  for (long long i = 1; i <= n; i++) H[0][i] = H[0][i - 1] * mod + str[0][i];
  for (long long i = n; i > 0; --i) H[1][i] = H[1][i + 1] * mod + str[0][i];
  for (long long i = 1; i <= m; i++) H[2][i] = H[2][i - 1] * mod + str[1][i];
  for (long long i = m; i > 0; --i) H[3][i] = H[3][i + 1] * mod + str[1][i];
}
void Solve() {
  vector<long long> Ans;
  for (long long i = 1; i <= n; i++) {
    if (H[0][i - 1] == H[2][i - 1] && H[1][i + 1] == H[3][i]) {
      Ans.push_back(i);
    }
  }
  cout << Ans.size() << '\n';
  for (__typeof((Ans).begin()) it = (Ans).begin(); it != (Ans).end(); ++it)
    cout << *it << " ";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Inp();
  Hash_build();
  Solve();
  return 0;
}
