import java.io.*;
import java.util.*;

public class names {
	
    
    public static void main(String[] args) throws FileNotFoundException {
    	
    	//Creates new Scanner and PrintStream objects 
    	Scanner scanner = new Scanner(new File("names.in"));
    	
    	//Gets the number of names
    	int num_names = scanner.nextInt();

		//Calculates the character stats for every name that is input
    	for (int i = 0; i < num_names; i++)
    	{
    	
    		//Grabs a new name
    		String input = scanner.next();
    		System.out.print(input);
    		
    		//Sets all the characters to lower their lower case counterparts
    		input = input.toLowerCase();
    		
    		//Checks the length of the name
    		int length = input.length();
    		
			//Starts off the character's health, power, and magic
			int health = 100;
    		int magic = 50;
    		int power = 30;
				
			//Adds 5 power if the name is greater than 7 characters
	    	if (length > 7)
	    	{
	    		power += 5;
	    	}
	    	//Adds 10 magic if the name is less than 5 characters
	    	else if (length < 5)
	    	{
	    		magic += 10;
	    	}
	    		
	    	//Saves the first and last characters
	    	char firstChar = input.charAt(0);
	    	char lastChar = input.charAt(length-1);
	    		
	    		
	    	if (isVowel(firstChar))
	    	{
	    		//If the name starts with a vowel, add 20 health
	    		health += 20;
	    	}
	    	if (isVowel(lastChar))
	    	{
	    		// If the name ends with a vowel, add 20 magic points, and subtract 10 points
	    		magic += 20;
	    		health -= 10;
	    	}
	    		
	    	//Checks every character to see if it's a vowel, adds magic, health, and power accordingly
	    	for (int j = 0; j < length; j++)
	    	{
	    		char curr = input.charAt(j);
	    		if (isVowel(curr))
	   			{
	   				magic += 3;
	   				health += 3;
	   				power += 1;
	   			}
	   		}
	    		
	    	//Checks the first and last characters for x, y, z adds stats accordingly
	    	if (firstChar == 'x' || lastChar == 'x' ||
	    		firstChar == 'y' || lastChar == 'y' ||
	   			firstChar == 'z' || lastChar == 'z')
	   		{
	   			magic += 10;
	   			health += 5;
	   			power += 2;
	   		}
	    		
	   		//Prints
	   		System.out.println(": " + health + " Health Points, " + magic + " Magic Points, " + power + " Power");		
    	}
    	
    	scanner.close();
    }
    //Checks to see if the character is a vowel
    private static boolean isVowel(char chr)
    {
    	return (chr == 'a' || chr == 'e' || chr == 'i' || chr == 'o' || chr == 'u');
    }
}