#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
long long int Max(long long int a, long long int b, long long int c) {
  return max(a, max(c, b));
}
void solve() {
  string st1, st2;
  cin >> st1 >> st2;
  int N = st1.size();
  char bad = '*';
  int index = -1;
  int happen = 0;
  int j = 0;
  for (int i = 0; i < N; i++) {
    if (j < N - 1 and st1[i] != st2[j]) {
      happen++;
      bad = st1[i];
      index = i;
    } else
      j++;
  }
  if (happen > 1) {
    cout << 0 << endl;
    return;
  }
  if (bad == '*') {
    index = N - 1;
    bad = st1[N - 1];
    int i = N - 1;
    int count = 0;
    while (i >= 0 and st1[i] == bad) {
      i--;
      count++;
    }
    cout << count << endl;
    for (int I = i + 1; I < N; I++) {
      cout << I + 1 << ' ';
    }
    return;
  }
  int count = 0;
  int i = index;
  while (i < N and st1[i] == bad) {
    i++;
    count++;
  }
  i = index - 1;
  int start = index;
  while (i >= 0 and st1[i] == bad) {
    count++;
    start--;
    i--;
  }
  cout << count << endl;
  for (int i = 0; i < count; i++) {
    cout << (start++) + 1 << ' ';
  }
  cout << endl;
  return;
}
int main() {
  bool test = false;
  if (test) {
    int tt;
    cin >> tt;
    while (tt > 0) {
      solve();
      tt--;
    }
  } else {
    solve();
  }
  return 0;
}
