Rulers of Centauri Prime

Given T country names, print for each whether its last letter marks a king, a queen, or nobody.

Easy1StringImplementationNo attempts yetTime limit5sMemory limit512 MB

Problem

Before the 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.

The vowels here are a, e, i, o and u, and letter case does not matter.

Given the names of several countries, determine who rules each one.

Input

The first line contains the number of test cases TT. Each of the next TT lines contains the name of one country. A country name starts with a capital English letter and continues with lower case English letters only. No line holds any other character, and there are no empty lines.

Output

For each test case, print one line in the form Case #x: C is ruled by Y. where xx is the case number starting from 1, CC is the country name from the input, and YY is one of a king, a queen or nobody.

Match this format exactly, including capitalization and the final period.

Constraints

  • 1T3001 \le T \le 300
  • Each country name has 1 to 100 letters.