Problem:
Score : 100 points

Problem Statement

In the Kingdom of AtCoder, people use a language called Taknese, which uses lowercase English letters.

In Taknese, the plural form of a noun is spelled based on the following rules:

If a noun's singular form does not end with s, append s to the end of the singular form.

If a noun's singular form ends with s, append es to the end of the singular form.

You are given the singular form S of a Taknese noun. Output its plural form.

Constraints

S is a string of length 1 between 1000, inclusive.

S contains only lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

Print the plural form of the given Taknese word.

Sample Input 1

apple

Sample Output 1

apples

apple ends with e, so its plural form is apples.

Sample Input 2

bus

Sample Output 2

buses

bus ends with s, so its plural form is buses.

Sample Input 3

box

Sample Output 3

boxs

Solution in C# (.NET Core 3.1.201) (judge verdict: Wrong Answer)

using System;

using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        //回答
        //Console.WriteLine(Math.Ceiling((double)N / X) * T);
        //Console.WriteLine("");

        //整数の入力
        //int input = int.Parse(Console.ReadLine());

        //文字列の入力
        //string input = Console.ReadLine();

        string input =Console.ReadLine();

        if(input.EndsWith("s"))
        {
            Console.WriteLine(input.Substring(0, input.Length - 1) + "es");
        }
        else
        {
            Console.WriteLine(input + "s");
        }

        /* 階乗 */
        //long fact = 1;

        ///* 自然数の入力 */
        //int num = int.Parse(Console.ReadLine()) ;


        //double tmp = ((double)num - 1) * num / 2;

        //Console.WriteLine("tmp : " + tmp);
        //Console.WriteLine("Math.Pow(8, num - 2) : " + Math.Pow(8, num - 2));
        //Console.WriteLine("res : " + ((double)tmp * Math.Pow(8, num - 2) * 2) % 1000000007);



        ////複数の入力
        //string[] line = Console.ReadLine().Split(' ');
        //int a = int.Parse(line[0]);
        //int b = int.Parse(line[1]);
        //int c = int.Parse(line[2]);
        //int d = int.Parse(line[3]);

        //if ((double)D/S <= T)
        //{
        //    Console.WriteLine("Yes");
        //}
        //else
        //{
        //    Console.WriteLine("No");
        //}



        ////文字列の入力
        //string S = Console.ReadLine();
        //string T = Console.ReadLine();

        //int ans = T.Length;
        //for (int i = 0; i < S.Length - T.Length + 1; i++)
        //{
        //    int count = 0;
        //    for (int j = 0; j < T.Length; j++)
        //    {
        //        if (S[i + j] != T[j])
        //        {
        //            count++;
        //            if (count >= ans)
        //            {
        //                break;
        //            }
        //        }
        //    }
        //    if (count < ans)
        //    {
        //        ans = count;
        //    }

        //    //Console.WriteLine(S.Substring(i, T.Length));
        //    //Console.WriteLine(count);
        //}
        //Console.WriteLine(ans);

        //////複数の入力
        //int N = int.Parse(Console.ReadLine());
        //string[] strArray = Console.ReadLine().Split(' ');
        //long[] A = strArray.Select(long.Parse).ToArray();
        //long[] sumArray = new long[A.Length];

        //long modNum = 1000000007;
        //long ans = 0;

        //long tmp = 0;
        //for(int j = N - 1; j >= 0; j--)
        //{
        //    tmp = (tmp + A[j]) % modNum;
        //    sumArray[j] = tmp;
        //}

        ////for (int i = 0; i < N; i++)
        ////{
        ////    Console.Write(sumArray[i] + " ");
        ////}
        ////Console.WriteLine();

        //for (int i = N - 1; i > 0; i--)
        //{
        //    long hoge = (A[i - 1] * sumArray[i]) % modNum;

        //    // Console.WriteLine(i + " : " + A[i - 1] + " * " + sumArray[i]);
        //    // Console.WriteLine("add : " + hoge);

        //    ans += hoge;

        //}

        //Console.WriteLine(ans % modNum);




        //    int j = i
        //    for (int j = i; j > i; j++)
        //    {
        //        long aiaj = (long)intArray[i] * intArray[j];
        //        ans += aiaj;
        //        //if(aiaj < modnum)
        //        //{
        //        //    ans += aiaj;
        //        //}
        //        //else
        //        //{
        //        //    ans += aiaj % modnum;
        //        //}
        //    }
        //}

        //Console.WriteLine(ans % modnum);



        //string[] line = Console.ReadLine().Split(' ');
        //int H = int.Parse(line[0]);
        //int W = int.Parse(line[1]);

        //line = Console.ReadLine().Split(' ');
        //int Ch = int.Parse(line[0]);
        //int Cw = int.Parse(line[1]);

        //line = Console.ReadLine().Split(' ');
        //int Dh = int.Parse(line[0]);
        //int Dw = int.Parse(line[1]);

        //string[] S = new string[H];

        //for(int i = 0; i < H; i++)
        //{
        //    // line = Console.ReadLine().Split('');
        //    string line2 = Console.ReadLine();
        //    //Console.WriteLine(line2);
        //    S[i] = line2;

        //    //for(int j = 0; j < W; j++)
        //    //{
        //    //    Console.WriteLine(line2[j]);
        //    //    //Console.WriteLine(S[i][j]);
        //    //}
        //}

        //for (int i = 0; i < H; i++)
        //{
        //    for (int j = 0; j < W; j++)
        //    {
        //    }
        //}


        ///////////////////////////////////////////////
        //long N = int.Parse(Console.ReadLine());
        //string[] A = Console.ReadLine().Split(' ');

        //long h = long.Parse(A[0]);
        //long dai_sum = 0;
        //for(long i = 1; i < N; i++)
        //{
        //    long ai = long.Parse(A[i]);
        //    //Console.WriteLine("-- " + i + "--");
        //    //Console.WriteLine("dai_sum : " + dai_sum);
        //    //Console.WriteLine("h : " + h);
        //    //Console.WriteLine("a[i] : " + ai);
        //    if (ai < h)
        //    {
        //        long dai = h - ai;
        //        dai_sum += dai;
        //        //Console.WriteLine("add dai : " + dai);
        //    }
        //    else
        //    {
        //        h = ai;
        //    }
        //}

        //Console.WriteLine(dai_sum);







        //==============
        //String N = Console.ReadLine();

        //int sum = 0;
        //for(int i =0;i< N.Length; i++)
        //{
        //    //Console.WriteLine("sum : " + sum);
        //    //Console.WriteLine("N[i] : " + (N[i] - '0'));
        //    sum += N[i] - '0';

        //}

        ////Console.WriteLine("sum : " + sum);

        //if (sum % 9 == 0)
        //{
        //    Console.WriteLine("Yes");
        //}
        //else
        //{
        //    Console.WriteLine("No");
        //}
        //=============



        //スペース区切りの整数の入力
        //string[] dates = Console.ReadLine().Split(' ');
        //string[] amounts = Console.ReadLine().Split(' ');

        //double date = double.Parse(input[0]);
        //double amount = double.Parse(input[1]);

        //double date = double.Parse(input[0]);
        //double amount = double.Parse(input[1]);

        //var L2 = L.Distinct().OrderBy(o => o);
        //var L2 = L.OrderBy(o => o).ToArray();

        //string input = Console.ReadLine();
        //int b = int.Parse(input[0]);
        //int c = int.Parse(input[1]);
        //文字列の入力
        //string s = Console.ReadLine();
        //出力


        //////////////////a
        //整数の入力
        //int N = int.Parse(Console.ReadLine());
        //if (N == 0)
        //{
        //    Console.WriteLine("1");
        //}
        //else
        //{
        //    Console.WriteLine("0");
        //}
        //////////////////b

        //////複数の入力
        //string[] line = Console.ReadLine().Split(' ');
        //int a = int.Parse(line[0]);
        //int b = int.Parse(line[1]);
        //int c = int.Parse(line[2]);
        //int d = int.Parse(line[3]);

        //long result = Math.Max(Math.Max((long)a * c, (long)a * d), Math.Max((long)b * c, (long)b * d));
        //Console.WriteLine(result);

        //////////////////b

    }
}