using System; using System.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[] q = new int[10]; for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(' '); for (int j = 0; j < 4; j++) { int m = int.Parse(s[j]); if (q[m] == -1) { continue; } if (s[4] == "YES") { q[m]++; } else { q[m] = -1; } } } Console.WriteLine(Array.IndexOf(q,q.Max())); } }