题目描述
Problem Background
OIers used to be able to play games and surf the internet freely. However, since the school computer lab implemented URL filtering, OIers have started looking for games on luogu. Just as they began playing slay.one, it got banned. Now, they can only play during weekdays for 2 hours at noon, and there are handsome teachers patrolling the lab. What should they do?
Problem Description
There are 3 handsome teachers named $A$, $B$, and $C$.
There are 5 students named $a$, $b$, $c$, $d$, and $e$. When any of them starts playing games, a message XX started playing games! is displayed. When any of them stops playing games, a message XX stopped playing games! is displayed.
When a teacher comes to inspect the lab, a message XX came! is displayed. If a teacher leaves, a message XX left! is displayed.
If a teacher catches a student currently playing games, output the student's name.
Input Format
There are $N$ messages.
The first line contains $N$. The second line contains the names of the 3 teachers, and the third line contains the names of the 5 students. The next $N$ lines contain the messages.
Output Format
Output the names of all students caught playing games by the teachers, sorted alphabetically.
If all students are caught playing games, additionally output How Bad Oiers Are!.
If no one is caught or no one is playing games, output How Good Oiers Are!.
Sample Input and Output
Sample Input #1
10
A B C
a b c d e
A came!
a started playing games!
b started playing games!
A left!
c started playing games!
d started playing games!
e started playing games!
B came!
PS:zhe_ge_yang_li_hen_zheng_chang!
B left!
Sample Output #1
a b c d e
How Bad Oiers Are!
Sample Input #2
10
I_Love_You I_Hate_You Why_Not_love_Me
Gay Che_Wan_Dang QwQ WuMaRu PDD
I_Love_You came!
Gay:Why do you love me?
I_Love_You died!
I_Love_You left!
Che_Wan_Dang prepared to play Dong_Fang!
But nobody came!
QwQ:I am so QwQ,I love myself!
PDD started playing Gay!
Gay died!And WuMaRu cried!
WuMaRu:dai su ki!
Sample Output #2
How Good Oiers Are!
Sample Input #3
20
Sans QwQ QAQ
A B C D E
A started playing B!
B started fighting with A!
A won!
A get 10000000 Exp!
QwQ:I and QAQ are looking at you all!
C died!
D died!
E recovered 123456789 HP!
E started playing games!
Sans came!
Sans:It is really a nice day today!
Sans:The birds are singing!
Sans:The flowers in bloom!
Sans:In a beautiful day like this!
Sans:People like you!
Sans:Should burn in hell!
E tried to attack Sans!
Sans was killed!
Sans:Papyrus,do you want something?
E still played his Undertale!
Sample Output #3
E
Sample Input #4
20
a b c
A B C D E
A came!
a started playing games!
b came!
b came together!
b came! dan_shi_zhe_ju_hua_bu_dui!
A came came came!
b start playing games!
b left!
c came!
c left!
A left!
B started playing games!
A started playing game!
C started palying games!
E started playing games!
lu_ren_jia came!
lu_ren_jia:What are you doing?
C&D:We are studying!
lu_ren_jia:Good boy!
C:qwq
Sample Output #4
How Good Oiers Are!
Notes/Hints
- For $20\%$ of the data, $1 \leq N \leq 23.3333333333333$.
- For $30\%$ of the data, $1 \leq N \leq 999.999$, one point has the answer
How Good Oiers Are!. - For $60\%$ of the data, $1 \leq N \leq 100,000$.
- For $99.9999999999999999999\%$ of the data, it is not guaranteed that all messages will conform to the problem statement.
- For $100\%$ of the data, $1 \leq N \leq 233,333$, and the data has a gradient.
Tips:
- Messages will definitely contain strange things.
- Messages must exactly match the problem statement to be valid.
- The examples are tricky; the data is pure.
- There will never be multiple teachers inspecting at the same time.
- Pay close attention to the problem and examples; there are pitfalls!
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分