#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 31) - 1;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
char str1[1000100], str2[1001000];
string s1, s2;
int par[1000010];
int main() {
  int i, j, cnt, ind;
  while (scanf("%s %s", str1, str2) == 2) {
    s1 = str1;
    s2 = str2;
    j = 0;
    memset(par, -1, sizeof(par));
    for (i = 0; i < ((int)s2.size()); i++) {
      for (j = j; j < ((int)s1.size()); j++)
        if (s1[j] == s2[i]) {
          par[j] = i;
          j++;
          break;
        }
    }
    cnt = 0;
    for (i = 0; i < ((int)s1.size()); i++)
      if (par[i] == -1) {
        ind = i;
        cnt++;
      }
    vector<int> ans;
    if (cnt == 1) {
      ans.push_back(ind);
      for (j = ind + 1; j < ((int)s1.size()); j++)
        if (s1[j] == s1[ind]) {
          ans.push_back(j);
        } else
          break;
      for (j = ind - 1; j >= 0; j--)
        if (s1[j] == s1[ind]) {
          ans.push_back(j);
        } else
          break;
      sort(ans.begin(), ans.end());
      printf("%d\n", ((int)ans.size()));
      for (i = 0; i < ((int)ans.size()); i++) printf("%d ", ans[i] + 1);
      printf("\n");
    } else
      printf("0\n");
  }
  return 0;
}
