fun f(m: Int, n: Int) = when { m==0 -> { for (i in 1..n) println(i*5) } else -> { for (i in 0..n) for (j in (if(i==0)1 else 0)..(if(m<5)m else 4)) println(i*5+j) for (i in 5..m) println(n*5+i) } } fun main(args: Array) { val (m,n) = readLine()!!.split(' ').map(String::toInt) f(m,n) }