      program AAA
!
      implicit none
      character(len=1002) :: S
      integer :: N
      integer :: i
!
      read(*,*) S
      N = len_trim(S)
      if(S(N:N) == 's') then  
        S(N+1:N+2) = 'es'
      else
        S(N+1:N+1) = 's'
      end if
!
      write(*,*) S
!
      end program AAA