Write a program that converts English nouns to their plural forms according to the rules below.
Note: these rules apply only for this problem and are not guaranteed to be 100% accurate for English in general.
Rules:
If a noun ends with ch
, sh
, s
, z
, or x
, add es
.
Example: the plural of box
is boxes
.
If a noun ends with y
, examine the letter before the y
.
If the preceding letter is a vowel (a
, e
, i
, o
, u
), simply add s
.
Example: the plural of toy
is toys
.
If the preceding letter is not a vowel, replace y
with ies
.
Example: the plural of story
is stories
.
For all other nouns, just add s
.
Constraints:
0 < n <= 80
Each line contains a lowercase English word of length at most n
.
The program must process all input until EOF.
Ex.box
toy
story
car
For each input word, output its plural form according to the rules above.
Ex.boxes
toys
stories
cars