#include <iostream>
#include<fstream>
#include<string>
#include<vector>
using namespace std;
ifstream in("strmatch.in");
ofstream out("strmatch.out");
string a,b;
void read()
{
in>>a>>b;
}
void search_for(string what,string in)
{
int size1=what.length();
int size2=in.length();
int cursor=0;
int cursor_in_first=0;
vector<int>solutions;
while(cursor<size2)
{
if(in[cursor]==what[cursor_in_first])
{
cursor_in_first++;
if(cursor_in_first==size1)
{
cursor=cursor-size1+1;
solutions.push_back(cursor);
cursor_in_first=0;
}
}
else
{
cursor_in_first=0;
if(in[cursor]==what[cursor_in_first])
cursor_in_first++;
}
cursor++;
}
out<<solutions.size()<<endl;
for(unsigned i=0; i<solutions.size(); i++)
{
out<<solutions[i]<<" ";
}
}
int main()
{
read();
search_for(a,b);
}