#include <bits/stdc++.h>
const int k = 10007;
const int max = 1e6;
unsigned long long first_prefixes[max], second_prefixes[max],
    first_suffixes[max], second_suffixes[max];
inline void fill_hashes_for(std::string string, int n,
                            unsigned long long *prefixes,
                            unsigned long long *suffixes) {
  prefixes[0] = (unsigned long long)(unsigned char)string[0];
  for (int i = 1; i < n; ++i) {
    prefixes[i] = (prefixes[i - 1] * k + string[i]);
  }
  suffixes[n - 1] = (unsigned long long)(unsigned char)string[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    suffixes[i] = (suffixes[i + 1] * k + string[i]);
  }
}
int main() {
  std::string first, second;
  std::cin >> first >> second;
  int first_len = (int)first.length();
  int second_len = (int)second.length();
  fill_hashes_for(first, first_len, first_prefixes, first_suffixes);
  fill_hashes_for(second, second_len, second_prefixes, second_suffixes);
  std::vector<int> result;
  for (int i = 0; i < first_len; ++i) {
    if ((i == 0 || first_prefixes[i - 1] == second_prefixes[i - 1]) &&
        (i == first_len - 1 || first_suffixes[i + 1] == second_suffixes[i]))
      result.push_back(i + 1);
  }
  printf("%d\n", result.size());
  for (int index : result) {
    printf("%d ", index);
  }
  return 0;
}
