#include <bits/stdc++.h>
using namespace std;
long long int p4[] = {-1, 1, 0, 0};
long long int q4[] = {0, 0, 1, -1};
long long int p8[] = {-1, 1, 0, 0, -1, 1, -1, 1};
long long int q8[] = {0, 0, 1, -1, 1, 1, -1, -1};
long long int gcd(long long int a, long long int b) {
  if (b > a) gcd(b, a);
  return ((b == 0) ? a : gcd(b, a % b));
}
long long int LCM(long long int a, long long int b) {
  long long int p = (a * b) / (gcd(a, b));
  return p;
}
long long int BigMod(long long int a, long long int b, long long int m) {
  if (!b) return 1;
  long long int ans = BigMod(a, b / 2, m);
  ans = (ans * ans) % m;
  if (b & 1) ans = (ans * a) % m;
  return ans;
}
long long int Mod_inv(long long int a) {
  return BigMod(a, 1000000007LL - 2, 1000000007LL);
}
long long int a[1000005], b[1000005], b2[1000005], c[1000005], c2[1000005];
vector<long long int> v, v1, v2;
map<long long int, long long int> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int i, j, k, l, m, n, d, p, q, h1, h2;
  long long int cs = 0, tc, t = 1, flg, f, sm;
  for (i = 0; i <= 1000000; i++) {
    a[i] = BigMod(31, i, 1000000007LL);
  }
  string s, s1, s2;
  while (cin >> s1 >> s2) {
    s1 = "*" + s1;
    h1 = h2 = 0;
    for (i = 1; i < s1.size(); i++) {
      b[i] = ((a[i - 1] * (s1[i] - 'a' + 1)) % 1000000007LL + b[i - 1]) %
             1000000007LL;
      c[i] = ((a[i - 1] * (s1[i] - 'a' + 1)) % 1000000009LL + c[i - 1]) %
             1000000009LL;
    }
    for (i = 2; i < s1.size(); i++) {
      b2[i] = ((a[i - 2] * (s1[i] - 'a' + 1)) % 1000000007LL + b2[i - 1]) %
              1000000007LL;
      c2[i] = ((a[i - 2] * (s1[i] - 'a' + 1)) % 1000000009LL + c2[i - 1]) %
              1000000009LL;
    }
    for (i = 0; i < s2.size(); i++) {
      h1 = ((a[i] * (s2[i] - 'a' + 1)) % 1000000007LL + h1) % 1000000007LL;
      h2 = ((a[i] * (s2[i] - 'a' + 1)) % 1000000009LL + h2) % 1000000009LL;
    }
    v.clear();
    for (i = 1; i < s1.size(); i++) {
      p = (b[i - 1] +
           ((b2[s1.size() - 1] - b2[i] + 1000000007LL) % 1000000007LL)) %
          1000000007LL;
      q = (c[i - 1] +
           ((c2[s1.size() - 1] - c2[i] + 1000000009LL) % 1000000009LL)) %
          1000000009LL;
      if (p == h1 && q == h2) {
        v.push_back(i);
      }
    }
    cout << v.size() << endl;
    for (i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
