import java.util.Scanner import java.io.{BufferedReader,InputStreamReader} object no24{ def main(args:Array[String]):Unit={ val scan = new Scanner(System.in) val n = scan.nextInt val res = scala.collection.mutable.ListBuffer.fill(10)(0) for(i <- Range(0,n)){ val nums = for(i <- 1 to 4) yield scan.nextInt val t = scan.next val pm = if(t.equals("YES")) 1 else -1 nums.foreach{ res(_) += pm } } val m = res.max for(i <- 0 to 9) if(res(i) == m) println(i) } }