program a179

implicit none
character(len=1002) :: s
integer :: i, j

read *, s

do i= 1, 1001
 if(s(i:i)==' ') then
  j = i-1
  exit
 end if
end do

!print *, j

if(s(j:j)=='s') then
 s(j+1:j+2) = 'es' 
else
 s(j+1:j+1) = 's'
end if

print *, trim(s)

end program a179