PRB4: The Not-So-Secret Language // Beginner

 
You've been brushing up on some history and discovered that Thomas Jefferson wrote using a form of Pig Latin in letters to some of his close friends! A fellow student, who was also interested by this fact, asked for you to make a program that takes words in English and translates them into Pig Latin. The rules for Pig Latin are as follows:

1) For words that begin with consonants, take the first letter, move it to the end of the word and add "ay"
2) For words that begin with a vowel, simply add a "way" to the end of the word

Input Format

Given that the first line contains an integer n representing the number of following words, followed by n more lines each with a single, lowercase word to be translated

Sample Input

3
lorem
ipsum
dolor

Output Format

Print n lines, each containing the given words translated into Pig Latin.

Sample Output

oremlay
ipsumway
olorday




You must be logged in to submit a solution.