{"trustable":false,"sections":[{"title":"Power By Solo_Dance","value":{"format":"HTML","content":"一个村庄有两类人,好人坏人, 好人总是说真话, 坏人总是说假话, 给你n个询问和好人、坏人的数量p q, 每个询问 x y yes/no, 表示 x 说 y 是 好/坏人。问是否能够唯一确定哪些是好人, 哪些是坏人, 如果可以输出好人的序号以\"end\"结尾, 否则输出\"no\""}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The 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\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n For 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.\n \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"}}]}