def print(str)
  last = str.size
  if str[last - 1] == 's'
    return str if str[last - 2] == 'e'
    return "#{str}es"
  end
  return str if str[last - 2] == 's'
  "#{str}s"
end

str = gets
puts print(str)