#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s, t;
  cin >> s >> t;
  int prf = t.size(), suf = 0;
  for (int i = 0; i < t.size(); i++) {
    if (s[i] != t[i]) {
      prf = i;
      break;
    }
  }
  for (int i = t.size(); i >= 0; i--) {
    if (s[i + 1] != t[i]) {
      suf = i + 1;
      break;
    }
  }
  if (prf > suf) swap(prf, suf);
  char c = s[prf];
  for (int i = prf; i <= suf; i++) {
    if (s[i] != c) {
      cout << "0\n";
      return 0;
    }
  }
  cout << suf - prf + 1 << "\n";
  for (int i = prf; i <= suf; i++) cout << i + 1 << " ";
  cout << "\n";
}
