### Description

There are two kinds of people living on an island, those who are good and those who are bad.

A good man always speaks the truth, and a bad man always lies.

Each member on the island has an integer number to distinguish each member like ID.

Now you have n opportunities to ask questions, but the content of the question can only be to ask one resident whether the other resident is a good person, please determine the identity of each resident according to the collected answers.

### Input

The input contains multiple sets of test cases.

The first line of each set of test cases contains three non-negative integers N,P1 and P2, where N is the total number of times you can ask questions, P1 isthe total number of good people, and P2 is the total number of bad people.

The next n lines each contain two integers xi, yi and a string Ai, where xi, yi is thenumber of the people on the island, and you're going to ask the people numbered xi whether the people numbered yi are good people,

ai is his answer, if ai is "yes", he answers you "yes", if ai is "no", he answers you "no".

xi,yi might be the same, which means you're asking whether the person is a good person.

When the input is a "0, 0, 0" on one line, the input is terminated.

Datarange:1≤xi,yi≤p1+p2,1≤n<1000,1≤p1,p2<300

### Output

For each set of test cases, if the query yields enough information for you to determine the identity of each resident, output the Numbers of all the good people on oneline, and then "end" on another line to indicate the end of the use case output.

If the information obtained is insufficient to determine the identity of each resident, then "no" is output, which also occupies one line.

Sample Input 1

2 1 1
1 2 no
2 1 no
0 0 0

Sample Output 1

no

Sample Input 2

2 2 1
1 2 yes
2 3 no
0 0 0

Sample Output 2

1
2
end

### Personal Answer  (using language：JAVA)  Not necessarily right


public class Main {
public static void main(String[] args) {
System.out.println("Unsolved");
}
}


Welcome to communicate!

12-08 77

09-23 348

04-13 2072

04-19 871

08-04 483

10-14 800

02-10 467

10-28 493

06-15 53

05-21 903

09-03 2万+

09-13 3万+

04-30 539

09-23 447

11-10 663

01-18 159

08-29 77

09-12 17

#### Good or Bad LightOJ - 1051

©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。