#include <iostream>
#include <iomanip>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void)
{
    string T, P;
    cin >> T >> P;
    int ans = 0;
    for (ans = 0; ans < (int)T.length() - (int)P.length() + 1; ans++)
    {
        if (T.compare(ans, P.length(), P) == 0)
        {
            // ans += P.length() - 1;
            cout << ans << "\n";
        }
    }
    return 0;
}
