#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> findAll(const string &haystack, const string &needle)
{
vector<int> result;
size_t pos = 0;
do {
pos = haystack.find(needle, pos);
if(pos!=string::npos) {
result.push_back(pos);
pos++;
}
} while(pos != string::npos);
return result;
}
int main()
{
string haystack, needle;
getline(cin, haystack);
getline(cin, needle);
vector<int>locations = findAll(haystack, needle);
for(auto itr = locations.begin(); itr!= locations.end(); itr++) {
cout << *itr << endl;
}
return 0;
}