|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|5 초||512 MB||101||81||77||81.053%|
Back in the old days before the creation of the mighty Centauri Republic, the planet Centauri Prime was split into several independent kingdoms. The kingdom of Mollaristan was ruled by king Loatold, while the kingdom of Auritania was under the rule of queen Elana. In fact, it just so happened that every kingdom whose name ended in a consonant was ruled by a king, while every kingdom whose name ended in a vowel was ruled by a queen. Also because of an amazing coincidence, all kingdoms whose named ended in the letter 'y' were constantly in a state of turmoil and were not ruled by anyone. Can you write a program that will determine the current rulers of several countries, given the countries' names?
The first line of the input gives the number of test cases, T. T lines follow, each one containing the name of one country. Country names will consist of only lower case English letters, starting with a capital letter. There will be no other characters on any line, and no empty lines.
For each test case, output one line containing "Case #x: C is ruled by Y.", where x is the case number (starting from 1), C is the country name, and Y is either "a king", "a queen" or "nobody".
Be careful with capitalization and the terminating period. Your output must be in exactly this format. See the examples below.
3 Mollaristan Auritania Zizily
Case #1: Mollaristan is ruled by a king. Case #2: Auritania is ruled by a queen. Case #3: Zizily is ruled by nobody.