#B2119. Suffix Removal from Words

    ID: 11201 Type: Default 1000ms 256MiB

Suffix Removal from Words

Suffix Removal from Words

Given a word, remove its suffix if it ends with one of the following: er, ly, or ing. It is guaranteed that after removing the suffix the word will not be empty (i.e. its length is not \(0\)). Otherwise, output the word unchanged.

For example, if the input is lovely, the output should be love because the suffix ly is removed.

inputFormat

The input consists of a single word on one line. The word contains only alphabetic characters.

outputFormat

Output the word after removing the suffix as described. If no specified suffix is present, output the word unchanged.

sample

lovely
love