#include <bits/stdc++.h>
using namespace std;
const int p = 31;
const int m = 1e9 + 9;
vector<long long> compute_hash(string const& s) {
  int n = s.size();
  vector<long long> pre_pow(n);
  pre_pow[0] = 1;
  for (int i = 1; i < n; ++i) {
    pre_pow[i] = (pre_pow[i - 1] * p) % m;
  }
  vector<long long> pre_hash(n + 1, 0);
  pre_hash[0] = 0;
  for (int i = 1; i <= n; ++i) {
    pre_hash[i] = pre_hash[i - 1];
    pre_hash[i] += ((s[i - 1] - 'a' + 1) * pre_pow[i - 1]) % m;
    pre_hash[i] %= m;
  }
  return pre_hash;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s, t;
  cin >> s >> t;
  auto a1 = compute_hash(s);
  auto a2 = compute_hash(t);
  int n1 = a1.size();
  int n2 = a2.size();
  long long total = (a2[n2 - 1] * p) % m;
  vector<int> ans;
  for (int i = 1; i < n1 - 1; ++i) {
    long long prev = a1[i - 1];
    long long nxt = (a1[n1 - 1] - a1[i] + m) % m;
    long long should_be = (prev * p + nxt) % m;
    if (should_be == total) {
      ans.push_back(i);
    }
  }
  long long prev = a1[n1 - 2];
  if (prev == a2[n2 - 1]) {
    ans.push_back(n1 - 1);
  }
  cout << ans.size() << '\n';
  for (auto i : ans) {
    cout << i << " ";
  }
  cout << '\n';
  return 0;
}
