t = gets.chomp.to_s
p = gets.chomp.to_s

hash = Hash.new(0)
t.scan(p) { |p| hash[p] += 1 }
i = 0
if hash[p] >= 1
  hash[p].times do
    output = t.index(p, i)
    puts output
    i += p.length
  end
else
  puts 0
end