program abc67
 implicit none
 integer(8)::length
 character(len=1000)::S
 read(*,*)S
 length=len_trim(S)
 if(S(length:length)=="s")then
  S(length+1:length+2)="es"
 else
  S(length+1:length+1)="s"
 end if
 print'(a)',trim(S)
 end program abc67