// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	input = input.split("\n");
	tmp = input[1].split(" ");
  	if(tmp.endsWith("s"){
    	console.log(tmp+"es");   
    } else {
    	console.log(tmp+"s");
    }
}
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));