fun main() { val (a,b) = readLine()!!.split(" ").map{it.toInt()} for (i in a..b) { if (i % 3 == 0 || "3" in i.toString()) { println(i) } } }