複数形の名詞

単数の名詞を複数形に変換するシンプルなプログラムを作りましょう。以下のように、いくつかのルールを守ります。
  1. 一般的な名詞の場合、語尾に s を付けます (cat → cats, house → houses, etc)
  1. 名詞の語尾が s, ss, sh, ch, x, または z の場合は、語尾に es を付けます (bus → buses, tax → taxes, etc)
  1. 名詞が y で終わり、なおかつ y の直前の文字が子音の場合は、語尾を ies に変えます (city → cities, puppy → puppies)
  1. 名詞が y で終わり、かつ y の直前の文字が母音の場合は、語尾に s を付けます (ray → rays, boy → boys, etc)

入力

入力として、単語 w が1つ与えられます (1 ≤ |w| ≤ 100)。

出力

このプログラムは、w の複数形を出力してください。

入力例
出力例
bus
buses
cat
cats
table
tables
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue