import scala.io.StdIn.readLine
import scala.collection.mutable.ArrayBuffer

object Main {

  def main(args:Array[String]) = {
    val t = readLine.trim
    val p = readLine.trim
    var i = 0
    val b = new ArrayBuffer[Int]

    while(i<t.length) {
      var found = true
      var j = 0

      while(found && j<p.length) {
        if(p(j)!= t(j+i)) found = false
        j += 1
      }

      if(found) b += i
      i += j
    }

    if(b.length>0) println(b.mkString("\n"))
  }
}