Given T country names, report for each whether a king, a queen, or nobody rules it from its last letter.
Easy1StringImplementationNo attempts yetTime limit5sMemory limit512 MBBefore the mighty Centauri Republic was founded, the planet Centauri Prime was split into several independent kingdoms. The kingdom of Mollaristan was ruled by king Loatold, and the kingdom of Auritania was ruled by queen Elana. In fact, every kingdom whose name ended in a consonant was ruled by a king, and every kingdom whose name ended in a vowel was ruled by a queen. By another coincidence, every kingdom whose name ended in the letter y was in constant turmoil and was ruled by nobody.
So the last letter of the name decides everything: y means nobody rules, one of the vowels a, e, i, o, u means a queen rules, and any other consonant means a king rules. Given several country names, write a program that reports the current ruler of each country.
The first line contains the number of test cases T. Each of the next T lines contains the name of one country. Country names consist of English letters only, with a capital first letter and lower case letters after it. No line contains any other character, and there are no empty lines.
For each test case, print one line in the format Case #x: C is ruled by Y., where x is the case number starting from 1, C is the country name from the input, and Y is one of a king, a queen or nobody.
Capitalization and the terminating period must match this format exactly.