fun r(): Int = readLine()!!.toInt() tailrec fun f(n: Int, a: Int, i: Int) { if (n > 1) { val t = if (r()>a) i+1 else i; println(t); f(n-1,a,t) } } fun main(args: Array) { println(1) f(r(),r(),1) }