#include <bits/stdc++.h>
using namespace std;
unsigned long long int has[1000001];
unsigned long long int has1[1000001], po[1000001];
unsigned long long int gethas(int L, int R) {
  return (has[R] - (has[L - 1] * po[R - L + 1]));
}
int main() {
  string s, s1;
  cin >> s >> s1;
  po[0] = 1;
  for (int i = 1; i <= (int)(s.size()); i++) {
    has[i] = has[i - 1] * 31 + (s[i - 1] - 'a' + 1);
    po[i] = po[i - 1] * 31;
  }
  int c = 0;
  for (int i = 1; i <= (int)(s1.size()); i++)
    has1[i] = has1[i - 1] * 31 + (s1[i - 1] - 'a' + 1);
  unsigned long long int z = has1[s.size() - 1], p2;
  vector<int> v;
  for (int i = 1; i <= s.size(); i++) {
    unsigned long long int p = has[i - 1];
    p2 = 0;
    if (i + 1 <= s.size()) {
      p2 = gethas(i + 1, s.size());
    }
    unsigned long long int zz = po[s.size() - i];
    p *= zz;
    if (p + p2 == z) {
      v.push_back(i);
      c++;
    }
  }
  cout << c << endl;
  for (auto i : v) cout << i << " ";
  cout << "\n";
}
