14778 - Plural Forms   

Description

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:

  1. If a noun ends with ch, sh, s, z, or x, add es.
    Example: the plural of box is boxes.

  2. 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.

  3. For all other nouns, just add s.

Constraints:

  • 0 < n <= 80

Input

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

Output

For each input word, output its plural form according to the rules above.

Ex.boxes
toys
stories
cars

Sample Input  Download

Sample Output  Download




Discuss