function Main(input) {

	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    
    let s = input[0];
    if (s[s.length-1] == "s") s += "es";
    else s += "s";
    
    console.log(s);
    
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));