405776: GYM102063 C Pig Latin

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Pig Latintime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

https://en.wikipedia.org/wiki/Pig_Latin

Pig Latin is a secret language which is similar to English. To convert an English word to Pig Latin, take the first letter of that word, move it to the end, and then add "ay".

Peccy and Danbo are two Amazon mascots. They like sending each other messages over Amazon Chime, but they've realised that their messages are unencrypted! Help Peccy and Danbo encrypt their messages by converting them into Pig Latin.

Make sure to check the examples.

Input

The first line will contain an integer T, where T is the number of sentences given.

Each sentence will be on a new line and will not contain punctuation. However, they will be capitalised at the beginning (but not anywhere else). Make sure you check the examples given.

Output

A list of sentences in Pig Latin. Each sentence should be on a new line and should not contain punctuation, but it should start with a capital letter.

ExamplesInput
1
Hello world
Output
Ellohay orldway 
Input
8
Hello danbo
Hello peccy
How are you today
Good how are you
Oh no
Whats wrong
It seems like our messages are not being encrypted
Dont panic
Output
Ellohay anboday 
Ellohay eccypay
Owhay reaay ouyay odaytay
Oodgay owhay reaay ouyay
Hoay onay
Hatsway rongway
Tiay eemssay ikelay uroay essagesmay reaay otnay eingbay ncryptedeay
Ontday anicpay
Note

Constraints:

1 ≤ T ≤ 20

Each sentence will not contain punctuation and will be all lowercase English characters, except for the very first letter of the very first word, which will be an uppercase English character.

加入题单

上一题 下一题 算法标签: