#include<bits/stdc++.h>
using namespace std;
string a,b;
int ans=0,tot=0;
int kw[1000005];
int main()
{
cin>>a>>b;
int l=b.size();
int i=0;
while(i<l)
{
if(a[i]!=b[i])
{
if(a[i+1]!=b[i]) {cout<<0;return 0;}
else
{
ans++;
kw[++tot]=i+1;
for(int j=i;j;j--)
{
if(a[j]==a[j-1])
{
ans++;
kw[++tot]=j;
}
else {break;}
}
break;
}
}
i++;
}
if(ans==0)
{
ans++;
kw[++tot]=i+1;
while(i>=0)
{
if(a[i]==a[i-1])
{
ans++;
kw[++tot]=i;
}
else {break;}
i--;
}
}
cout<<ans<<endl;
for(int i=ans;i>0;i--)
{
cout<<kw[i]<<" ";
}
return 0;
}