str = gets.chomp.to_s
input = gets.chomp.to_s

input.length.times do |i|
  break if str.length < i + 1
  str.length.times do |s|
    next unless str[s, i + 1].include?(input[0, i + 1])
    puts str.index(input[0, i + 1], s) if i + 1 == input.length
  end
end