#include <cstdio>
#include <cstring>
#define lim 2000010
using namespace std;
char P[lim],T[lim];
int b[lim];
int sol[lim];
int m,n;
void kmp_process(){
int i = 0,j=-1;
m = strlen(P);
b[0] = -1;
while(i < m){
while(j >=0 && P[i] != P[j])
j = b[j];
i++;
j++;
b[i] = j;
}
}
int display = 0;
int cnt = 0;
void kmp()
{
int i=0,j=0,n=strlen(T);
while(i < n){
while(j >= 0 && T[i] != P[j])
j = b[j];
i++;
j++;
if(j == m){
sol[cnt++] = i - j;
j = b[j];
}
}
display = (cnt > 1000)? 1000:cnt;
}
int main(){
freopen("strmatch.in","r",stdin);
freopen("strmatch.out","w",stdout);
scanf("%s%s",P,T);
kmp_process();
kmp();
printf("%d\n",cnt);
for(int i = 0; i < display; i++)
printf("%d ",sol[i]);
return 0;
}