#include<bits/stdc++.h>
using namespace std;

int main(){
    string s1, s2;
    cin >> s1;
    cin >> s2;
    int s1_len, s2_len;
    s1_len = s1.length();
    s2_len = s2.length();

    if(s2_len <= s1_len){
        for(int i = 0; i < s1_len; i++){
            if(s1.substr(i, s2_len) == s2){
                cout << i << "\n";
            }
    }

    }
}

