#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
using namespace std;
#define dbg(x) (cout<<#x<<" = "<<(x)<<'\n')
#ifdef HOME
const string inputFile = "input.txt";
const string outputFile = "output.txt";
#else
const string problemName = "strmatch";
const string inputFile = problemName + ".in";
const string outputFile = problemName + ".out";
#endif // HOME
typedef long long int lld;
typedef pair<int, int> PII;
typedef pair<int, lld> PIL;
typedef pair<lld, int> PLI;
typedef pair<lld, lld> PLL;
const int INF = (1LL << 31) - 1;
const lld LINF = (1LL << 62) - 1;
const int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};
const int MOD = (int)(1e9) + 7;
const int NMAX = 50000 + 5;
const int MMAX = 100000 + 5;
const int KMAX = 100000 + 5;
const int PMAX = 100000 + 5;
const int LMAX = 2000000 + 5;
const int VMAX = 100000 + 5;
int LA, LB;
char A[LMAX];
char B[LMAX];
int pi[LMAX];
int nrMatches;
int matches[1005];
void prefix() {
int i, q = 0;
for(i = 2; i <= LA; i++) {
while(q && A[q + 1] != A[i])
q = pi[q];
if(A[q + 1] == A[i])
q++;
pi[i] = q;
}
}
void kmp() {
int i, q = 0;
for(i = 1; i <= LB; i++) {
while(q && A[q + 1] != B[i])
q = pi[q];
if(A[q + 1] == B[i])
q++;
if(q == LA) {
nrMatches++;
if(nrMatches <= 1000)
matches[nrMatches] = i - LA;
q = pi[q];
}
}
}
int main() {
int i;
#ifndef ONLINE_JUDGE
freopen(inputFile.c_str(), "r", stdin);
freopen(outputFile.c_str(), "w", stdout);
#endif
scanf("%s", A + 1);
scanf("%s", B + 1);
LA = strlen(A + 1);
LB = strlen(B + 1);
prefix();
kmp();
printf("%d\n", nrMatches);
for(i = 1; i <= min(nrMatches, 1000); i++)
printf("%d ", matches[i]);
return 0;
}