using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); bool[] bN = new bool[10]; for (int i = 0; i < N; i++) { bool[] bY = new bool[10]; var vs = Console.ReadLine().Split().ToList(); var vn = vs.Take(4).Select(int.Parse).ToList(); if (vs[4] == "YES") { vn.ForEach(n => bY[n] = true); for (int j = 0; j < 10; j++) { if (!bY[j]) bN[j] = true; } } else vn.ForEach(n => bN[n] = true); } for (int i = 0; i < 10; i++) if (!bN[i]) Console.WriteLine(i); //Console.ReadLine(); } } }