fun main() { val i = readLine()!!.toInt() val cheater = LinkedHashMap(i) repeat(i) { val (c, d) = readLine()!!.split(" ") cheater[c] = d } val ok = ArrayList() cheater.values.forEach { // 被害者 if (it !in cheater.keys) { ok += it } } ok.distinct().forEach { println(it) } }