#include <iostream>
#include <string>
using namespace std;

int main() {
    string t, p;
    cin >> t >> p;
    const auto l_t = t.length();
    const auto l_p = p.length();
    if (l_t < l_p) exit(0);
    for (auto i = 0; i <= l_t - l_p; ++i)
        if (t.substr(i, l_p) == p) cout << i << endl;
}
