{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eAfuckfuck those of the devilish tribe are liars, that is, they always tell a lie.\n\u003cbr\u003e\n\u003cbr\u003eHe asked some of them whether or not some are divine. They knew one another very much and always responded to him \"faithfully\" according to their individual natures (i.e., they always tell the truth or always a lie). He did not dare to ask any other forms of questions, since the legend says that a devilish member would curse a person forever when he did not like the question. He had another piece of useful informationf the legend tells the populations of both tribes. These numbers in the legend are trustworthy since everyone living on this island is immortal and none have ever been born at least these millennia.\n\u003cbr\u003e\n\u003cbr\u003eYou are a good computer programmer and so requested to help Akira by writing a program that classifies the inhabitants according to their answers to his inquiries.\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe input consists of multiple data sets, each in the following format :\n\u003cbr\u003e\n\u003cbr\u003en p1 p2\n\u003cbr\u003exl yl a1\n\u003cbr\u003ex2 y2 a2\n\u003cbr\u003e...\n\u003cbr\u003exi yi ai\n\u003cbr\u003e...\n\u003cbr\u003exn yn an\n\u003cbr\u003e\n\u003cbr\u003eThe first line has three non-negative integers n, p1, and p2. n is the number of questions Akira asked. pl and p2 are the populations of the divine and devilish tribes, respectively, in the legend. Each of the following n lines has two integers xi, yi and one word ai. xi and yi are the identification numbers of inhabitants, each of which is between 1 and p1 + p2, inclusive. ai is either yes, if the inhabitant xi said that the inhabitant yi was a member of the divine tribe, or no, otherwise. Note that xi and yi can be the same number since \"are you a member of the divine tribe?\" is a valid question. Note also that two lines may have the same x\u0027s and y\u0027s since Akira was very upset and might have asked the same question to the same one more than once.\n\u003cbr\u003e\n\u003cbr\u003eYou may assume that n is less than 1000 and that p1 and p2 are less than 300. A line with three zeros, i.e., 0 0 0, represents the end of the input. You can assume that each data set is consistent and no contradictory answers are included.\n\u003cbr\u003e\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eFor each data set, if it includes sufficient information to classify all the inhabitants, print the identification numbers of all the divine ones in ascending order, one in a line. In addition, following the output numbers, print end in a line. Otherwise, i.e., if a given data set does not include sufficient information to identify all the divine members, print no in a line.\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e2 1 1\n1 2 no\n2 1 no\n3 2 1\n1 1 yes\n2 2 yes\n3 3 yes\n2 2 1\n1 2 yes\n2 3 no\n5 4 3\n1 2 yes\n1 3 no\n4 5 yes\n5 6 yes\n6 7 no\n0 0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003eno\nno\n1\n2\nend\n3\n4\n5\n6\nend\u003c/pre\u003e"}}]}