import kotlin.coroutines.experimental.* fun main(args : Array) { val N = (readLine() ?: "").toInt() buildSequence { yieldAll(N downTo 1) } .map { buildSequence { for (j in 1..it) yield(N) } .joinToString("") } .forEach { println(it) } }