using System; using System.Collections.Generic; using System.Linq; namespace StudyApp { class Program { static void Main(string[] args) { int turn = int.Parse(Console.ReadLine()); var possible_nums = new List { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; for (int i = 0; i < turn; i++) { string[] inputs = Console.ReadLine().Split(' '); if (inputs[4].Equals("NO")) { possible_nums.RemoveAll(num => inputs.Contains(num)); } else { possible_nums.RemoveAll(num => !inputs.Contains(num)); } } Console.WriteLine(possible_nums.First()); } } }