#include <bits/stdc++.h>
using namespace std;
ifstream fin("strmatch.in");
ofstream fout("strmatch.out");
const int NMAX = 2e6;
int n, pi[2 * NMAX + 1], cnt, ans[1000];
string s, t;
void precalculare()
{
pi[0] = 0;
for(int i = 1; i < n; i++)
{
int j = pi[i - 1];
while(j > 0 && s[i] != s[j])
j = pi[j - 1];
j += (s[i] == s[j]);
pi[i] = j;
}
}
int main()
{
fin >> s >> t;
s = s + ' ' + t;
n = s.size();
precalculare();
int m = 0;
while(s[m] != ' ')
m++;
for(int i = m + 1; i < n; i++)
{
if(pi[i] == m)
{
if(cnt <= 1000)
ans[cnt] = i - 2 * m;
cnt++;
}
}
fout << cnt << "\n";
for(int i = 0; i < min(cnt, 1000); i++)
fout << ans[i] << " ";
fin.close();
fout.close();
return 0;
}