program answer
  implicit none
  integer(8) :: N
  character(len=1000) :: S
  character(len=1001) :: ans
  read(*,*) S
  n=len_trim(S)
  if(S(N:N)=='s') then
     ans=S(1:N)//'es'
     write(*,*) ans
  else
     ans=S(1:N)//'s'
     write(*,*) ans
  end if

  stop
 end program answer