#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  string a, b;
  cin >> a >> b;
  int N = b.length();
  int cs1[26] = {0}, cc = 0, cs2[26] = {0};
  bool v = 1;
  for (int i = (0); i < (N); ++i) cs1[b[i] - 'a']++;
  for (int i = (0); i < (N + 1); ++i) cs2[a[i] - 'a']++;
  for (int i = (0); i < (26); ++i) cc += abs(cs1[i] - cs2[i]);
  v = cc == 1;
  int p = 0;
  for (int i = (0); i < (N); ++i)
    if (b[i] == a[i])
      p = i + 1;
    else
      break;
  for (int i = (p + 1); i < (N + 1) && (v); ++i) v = b[i - 1] == a[i];
  if (!v)
    puts("0");
  else {
    int L = p, R = p;
    for (int i = (p); i < (N); ++i)
      if (a[i + 1] == a[p])
        R++;
      else
        break;
    for (int i = (p); i >= (1); --i)
      if (a[i - 1] == a[p])
        L--;
      else
        break;
    printf("%d\n", R - L + 1);
    for (int i = (L); i < (R + 1); ++i) printf("%d ", i + 1);
    puts("");
  }
  return 0;
}
