/*
	Lisa Soros
	BHCSI 2010
	Programming Contest problem using String class methods
*/

import java.io.*;
import java.util.*;

public class winkle
{
	public static void main(String[] args) throws IOException
	{
		// Declare variables
		String token;
		int numSentences, numWords;
		
		// Initialize the file scanner
		Scanner fileScanner = new Scanner(new File("winkle.in"));
		numSentences = fileScanner.nextInt();
		
		for(int i=0; i<numSentences; i++)
		{
			numWords = fileScanner.nextInt();
			for(int j=0; j<numWords; j++)
			{
				// Get the next token 
				token = fileScanner.next();
				
				// If the word ends in a z (pluralized), change the last character to an s
				if(token.charAt(token.length()-1)=='z')
				{
						for(int k=0; k<token.length()-1; k++)
						{
							System.out.print(token.charAt(k));
						}
						System.out.print("s ");
				}
				
				// Perform various word substitutions
				else if(token.equals("sup"))
				{
					System.out.print("good day to you ");
				}
				else if(token.equals("1337"))
				{
					System.out.print("most extraordinary ");
				}
				else if(token.equals("d00d"))
				{
					System.out.print("esteemed gentleman ");
				}
				else if(token.equals("<3"))
				{
					System.out.print("harbor feelings of adoration towards ");
				}
				else
				{
					System.out.print(token+ " ");
				}
			}
			System.out.println();
		}
	}
}
