#include <bits/stdc++.h>
using namespace std;
priority_queue<long long> pq;
long long i, j;
char ch;
string a, b;
int main() {
  pq = priority_queue<long long>();
  long long c = 0;
  cin >> a >> b;
  for (i = 0; i < a.size(); i++) {
    if (a[i] != b[i]) {
      ch = a[i];
      long long p = i, x = i;
      for (j = i - 1; j >= 0; j--) {
        if (a[j] == ch) {
          if (x - j == 1) {
            x = j;
            pq.push((j + 1) * -1);
          }
        }
      }
      for (j = i; j < a.size(); j++) {
        if (a[j] == ch) {
          if (pq.size() == 0 || j - p == 1 || j - p == 0) {
            p = j;
            pq.push((j + 1) * -1);
          }
        }
      }
      break;
    }
  }
  long long j = 0;
  for (i = 0; i < a.size(); i++) {
    if (a[i] != b[j]) {
      c++;
      continue;
    } else {
      j++;
    }
  }
  if (c > 1)
    cout << 0 << endl;
  else {
    cout << pq.size() << endl;
    while (!pq.empty()) {
      cout << pq.top() * -1;
      pq.pop();
      if (pq.empty())
        cout << endl;
      else
        cout << " ";
    }
  }
  return 0;
}
