readLine.tails.toList.reverseMap(_.inits.toList.init.reverseMap(println))