#include <bits/stdc++.h>
using namespace std;
int A[30], B[30];
int main() {
  string s, t;
  cin >> s >> t;
  vector<int> v;
  bool ok = true;
  int sz = t.size();
  int sz1 = s.size();
  for (int i = 0; i < sz1; i++) {
    A[s[i] - 'a']++;
  }
  for (int i = 0; i < sz; i++) {
    B[t[i] - 'a']++;
  }
  int e = 0;
  for (int i = 0; i < 26; i++) {
    if (A[i] != B[i]) e++;
  }
  if (e != 1) {
    puts("0");
    return 0;
  }
  int cnt = 0;
  for (int i = 0, j = 0; i < sz; i++, j++) {
    if (s[i] != t[j]) {
      v.push_back(i);
      cnt++;
      j--;
    }
  }
  if (cnt == 0) {
    v.push_back(sz);
    cnt++;
  }
  if (cnt == 1) {
    int r = v[0];
    char ch = s[r];
    v.clear();
    for (int i = r; i >= 0; i--) {
      if (s[i] == ch)
        v.push_back(i + 1);
      else
        break;
    }
    for (int i = r + 1; i < sz + 1; i++) {
      if (s[i] == ch)
        v.push_back(i + 1);
      else
        break;
    }
    sort(v.begin(), v.end());
    int z = v.size();
    cout << z << endl;
    for (int i = 0; i < z; i++) {
      if (i) cout << ' ';
      cout << v[i];
    }
    cout << endl;
  } else {
    puts("0");
  }
}
