t = gets.chomp.to_s
p = gets.chomp.to_s
before_output = 0
if t.length > p.length
  t.length.times do |i|
    break if t.length - i < p.length
    if i.zero?
      output = t.index(p)
      i += 1
    else
      output = t.index(p, i)
      next if output == before_output
      break if output.nil?
      i = output + 1
      before_output = output
    end
    puts output
    before_output = output
  end
else
  puts 0
end