//config = { input: 'tmp', newline: '\r\n' }; // win
config = { input: '/dev/stdin', newline: '\n' }; // linux

line = require('fs').readFileSync(config.input, 'ascii')
  .split(config.newline, 2);

T = line[0];
P = line[1];
line = null;

res = new Array(T.length);
idx = 0;
j = 0;
while ((idx = T.indexOf(P, idx)|0) !== -1) {
  res[j] = idx;
  idx = (idx + 1)|0;
  j = (j + 1)|0;
}

res.length = j;
if (res.length !== 0) console.log(res.join('\n'));