fun main() { val n = readLine()!!.trim().toInt() val box = List(n){ readLine()!!.trim().toInt()} val nim = IntArray(n) for (i in 0 until n) { val a = box[i] var x = a val list = mutableListOf() for (j in i - 1 downTo 0) { list.add(x xor nim[j]) x = x xor box[j] } list.add(x) list.sort() nim[i] = list.indices.find { it != list[it] } ?: list.size } val winFirst = nim.last() != 0 println(if (winFirst) "Takahashi" else "Takanashi") }