#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long pows(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long powm(long long x, long long y, long long m = 1000000007) {
  x = x % m;
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x;
    res %= m;
    y = y >> 1;
    x = x * x;
    x %= m;
  }
  return res;
}
long long modInverse(long long a, long long m = 1000000007) {
  return powm(a, m - 2, m);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, i, j, k, x, y, z, t, e, f, p, q, g, l, r, o, w, h,
      count1 = 0, prod = 1, a, b, c, d, index, x1, x2, y1, y2, diff, ans = 0,
      sum = 0, sum1 = 0, sum2 = 0, flag = 0, flag1 = 0, flag2 = 0;
  string s, s1, s2;
  cin >> s >> s1;
  p = 31;
  n = s.size();
  m = s1.size();
  long long powers[n + 1];
  powers[0] = 1;
  for (i = 1; i <= n; i++) {
    powers[i] = powers[i - 1] * p;
    powers[i] %= 1000000007;
  }
  long long pre[n + 1];
  pre[0] = 0;
  for (i = 0; i < n; i++) {
    pre[i + 1] = (pre[i] + (s[i] - 'a' + 1) * powers[i]) % 1000000007;
  }
  long long hs = 0;
  for (i = 0; i < m; i++) {
    hs = (hs + (s1[i] - 'a' + 1) * powers[i]) % 1000000007;
  }
  vector<long long> v;
  if (((pre[n] - pre[1] + 1000000007) % 1000000007) ==
      ((hs * p) % 1000000007)) {
    v.push_back(1);
  }
  for (i = 2; i <= n; i++) {
    x = (pre[n] - pre[i] + 1000000007) % 1000000007;
    x += (pre[i - 1] * p) % 1000000007;
    x %= 1000000007;
    if (x == (hs * p) % 1000000007) {
      v.push_back(i);
    }
  }
  cout << v.size() << "\n";
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
}
