#include <iostream>
#include <string>
int MaxBorder(std::string s){
int ans = 0;
std::string t = "";
for (int i = 0;i < s.length() - 1;i++){
t += s[i];
if (s.find(t,s.length() - t.length()) != -1) ans = std::max(ans,(int)t.length());
}
return ans;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("P3375.in","r",stdin);
freopen("P3375.out","w",stdout);
#endif
std::cin.tie(0)->sync_with_stdio(0);
int pos = -1;
std::string s1,s2,s = "";
std::cin >> s1 >> s2;
while ((pos = s1.find(s2,pos + 1)) != -1) std::cout << pos + 1 << '\n';
for (char c : s2) s += c,std::cout << MaxBorder(s) << ' ';
return 0;
}