Please read the new rule regarding the restriction on the use of AI tools. ×

Mock Div. 4 Practice Contest — Problem B

Revision en1, by megahertz13, 2024-10-02 18:50:04

Post your code in the comments to get featured.

B. Name Change

Input file: standard input

Output file: standard output

Time limit: 1 second

Memory limit: 256 megabytes

MegaMath Channel is trying to change its name. A new name with no spaces is called valid if it is distinct from "MegaMath Channel" and it is a permutation of the letters (exclude the space) in "MegaMath Channel". For example, "MegaChanneMathl" is a valid new name, while "MegaChanne Mathl" is not (it has a space). Your task is to find whether a given name is valid or not.

Input

The first line contains the number of names t (1 <= t <= 1000).

The next n lines contain a single string n, where n is a possible name.

Output

Output "Yes" if a given name is valid, and output "No" otherwise.

Sample Code by [blank]:

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English megahertz13 2024-10-02 18:50:04 890 Initial revision (published)