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 Java (OpenJDK 11.0.6) (judge verdict: Runtime Error)

import java.util.Scanner;
public class Main{
	static private Scanner scanner;
	static{
		scanner = new Scanner(System.in);
	}
	static public void main(String[] args){
		m2();
	}
	static public void m1(){
		String s = scanner.next();
	  	String result;
		if(s.endsWith("s")){
			result = s + "es";
		}else{
			result = s + "s";
		}
		System.out.println(result);

	}
	static public void m2(){
		int n = scanner.nextInt();
		boolean result = false;
		boolean[] ba = new boolean[]{false,false,false};
		String s;
		String[] sa;
		int d1;
		int d2;
		for(int i = 0; i < n; i++){
			//s = scanner.next();
			//sa = s.split(" ");
			d1 = scanner.nextInt();//Integer.parseInt(sa[0]);
			d2 = scanner.nextInt();//Integer.parseInt(sa[1]);
			if( d1 == d2 ){
				if( ba[0] == false ){
					ba[0] = true;
				}else{
					if( ba[1] == false ){
						ba[1] = true;
					}else{
						if( ba[2] == false ){
							ba[2] = true;
							result = true;
						}else{
						}
					}
				}
				
			}else{
				ba = new boolean[]{false,false,false};
			}

		}
		if(result == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}

	}
}