#include <fstream>
#include <vector>
#define tip long long
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
string a,b;
tip A, B, i, j, cnt, ap[1010], ha, hb, x=2LL, m=33311LL, u, v,
X=3LL,M=2003,U,V,HA,HB,
putere(tip, tip, tip);
int main()
{
f>>a>>b;
A=a.size();
B=b.size();
for(i=0, j=1; i<A; i++,j=(j*x)%m)
{
ha=(ha+a[i]*j)%m;
hb=(hb+b[i]*j)%m;
}
for(i=0, j=1; i<A; i++,j=(j*X)%M)
{
HA=(HA+a[i]*j)%M;
HB=(HB+b[i]*j)%M;
}
if((ha==hb)&&(HA==HB))
{
cnt++;
if(cnt<=1000)
ap[cnt]=0;
}
u=putere(x, m-2,m);
U=putere(X, M-2,M);
v=putere(x, A-1,m);
V=putere(X, A-1,M);
for(j=0,i=A; i<B; i++,j++)
{
hb=((hb+m-b[j])*u+v*b[i])%m;
HB=((HB+M-b[j])*U+V*b[i])%M;
if((ha==hb)&&(HA==HB))
{
cnt++;
if(cnt<=1000)
ap[cnt]=j+1;
}
}
g<<cnt<<"\n";
j=min(1000LL, cnt);
for(i=1; i<=j; i++)
g<<ap[i]<<' ';
return 0;
}
tip putere(tip b, tip e,tip md)
{
tip r = 1;
for(;e;e/=2)
{
if(e%2==1)
r=(r*b)%md;
b=(b*b)%md;
}
return r;
}