#include <bits/stdc++.h>
using namespace std;
long long int B = 257;
char s[1000100];
char t[1000100];
int n;
int m;
unsigned long long int hash1[1000100];
unsigned long long int hash2[1000100];
struct resp {
  unsigned long long int count;
  unsigned long long int indices[1000100];
} indice;
long long int expBinaria(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b % 2) res = res * a;
    b = b / 2;
    a = a * a;
  }
  return res;
}
void armaHashes() {
  hash1[0] = 0;
  for (int i = 1; i <= n; i++) {
    hash1[i] = hash1[i - 1] * B + s[i - 1];
  }
  hash2[0] = 0;
  for (int i = 1; i <= m; i++) {
    hash2[i] = hash2[i - 1] * B + t[i - 1];
  }
}
long long int h_1(int i, int j) {
  return hash1[j] - hash1[i - 1] * expBinaria(B, j - i + 1);
}
long long int h_2(int i, int j) {
  return hash2[j] - hash2[i - 1] * expBinaria(B, j - i + 1);
}
void solve() {
  long long int cuenta = 0;
  if (h_1(2, n) == h_2(1, m)) {
    indice.indices[cuenta] = 1;
    cuenta++;
  }
  for (int i = 2; i < n; i++) {
    if (h_1(1, i - 1) == h_2(1, i - 1) && h_1(i + 1, n) == h_2(i, m)) {
      indice.indices[cuenta] = i;
      cuenta++;
    }
  }
  if (h_1(1, n - 1) == h_2(1, m)) {
    indice.indices[cuenta] = n;
    cuenta++;
  }
  indice.count = cuenta;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  cin >> t;
  n = strlen(s);
  m = strlen(t);
  armaHashes();
  solve();
  cout << indice.count;
  cout << "\n";
  for (int i = 0; i < indice.count; i++) {
    cout << indice.indices[i];
    cout << "\t";
  }
  return 0;
}
