//Pig Latin Programming Contest Question
//July 26, 2006


import java.io.*;
import java.util.*;


public class latin
{
	
	public static void main(String [] args) throws IOException
	{
		Scanner input =  new Scanner(new File("latin.in"));
		
		//scan in the number of words
		int numwords = input.nextInt();
		
		//loop through all the words
		for(int a = 0; a < numwords; a++)
		{
			//Scan in the words as lowercase, not necessary based on the spec.
			String temp = (input.next()).toLowerCase();
			
			//if the first letter is a vowel
			if(temp.charAt(0) == 'a' || temp.charAt(0) == 'e' || temp.charAt(0) == 'i' || temp.charAt(0) == 'o' || temp.charAt(0) == 'u')
			{
				System.out.println(temp + "ay");
			}
			//else, it's a consonant
			else
			{
				System.out.println(temp + temp.charAt(0) + "ay");
				
			}
			
		}
		
	}
	
}