readLine.toSeq.foldRight((Seq.empty[String],""))((c,a)=>(a._1:+(c+:a._2),c+:a._2))._1.sorted.map(println(_))