fun main(args: Array) { val n = readLine()!!.toInt() val dic = MutableList(10) { 1 } for (i in 0 until n) { val input = readLine()!!.split(" ") for (j in 0 until 4) { dic[input[j].toInt()] *= listOf(0, 2)[if (input.last() == "NO") 0 else 1] } } println(dic.indexOf(dic.max())) }