import java.util.* fun main(args: Array) { val cin = Scanner(System.`in`) val n = cin.nextInt() val dic = mutableListOf() for (i in 0 until n) { val abcd = mutableListOf() for (j in 0 until 4) { abcd.add(cin.nextInt()) } val r = cin.next() for (k in 0 .. 9) { if ((r == "YES" && k !in abcd) || (r == "NO" && k in abcd)) { dic.add(k) } } } for (ans in 0 .. 9) { if (ans !in dic) println(ans) } }