SSY and JLBD Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 527 Accepted Submission(s): 240
Problem Description Mahjong is a board game with a long history. But Mahjong has different rules in different city.
A deck of mahjong consists of 136 cards. It contains 1-9 card in three suits,and Seven kinds of word card£¨"dong","nan","xi","bei",¡°zhong¡±,"fa","bai"£©,there are 4 same cards for each kind of card in a deck of mahjong .
In a mysterious country, the rules of mahjong are very simple.In the game,each Player has 14 cards.There are only two ways people can win the game:
1. shisanyao:You should have all 1 and 9 card in three suits and seven kinds of word card at the same time£¬and an extra card with any kind of 1 and 9 or word.
2. jiulianbaodeng£ºFirstly,You should make sure that you have the same suit in your hand.Secondly, for card "1" and card "9",you should have at least three . but for card "2" to card "8"£¬at least one.For example, both "11112345678999" and "11122345678999" can win the game.
Now you know a player's 14 cards. Please judge which card type he can use to win the game.
Input The input file contains 14 lines.Each line has a string representing a card.
For three suits of card "1" to card "9",We use two characters for the type£¬the first character a is number 1 to 9,and the second character b represents the suit.($a \in \{1,2,3,4,5,6,7,8,9\},b \in \{s,p,w\}$)
For the word cards£¬as shown in the description£¬we use full spelling pinyin represent them.
Output If player ¡®s card meet the ¡°shisanyao¡± condition, you should output "shisanyao!".
If player ¡®s card meet the ¡°jiulianbaodeng¡± condition, you should output "jiulianbaodeng!".
Otherwise,you should output "I dont know!".
Sample Input 1w
5w
2w
6w
5w
9w
9w
7w
1w
3w
9w
4w
1w
8w
Sample Output Statistic | Submit | Clarifications | Back
|