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

int main() {
  string T, P;
  cin >> T >> P;

  int t = T.size();
  int p = P.size();
  for ( int i = 0; i <= t-p; i++ ) {
    if ( P == T.substr(i, p) ) cout << i << endl;
  }
  
  return 0;
}

