implicit none character(52) Q,S integer(8) o,t,u,v,w,x,y,z read(*,*) S,t,u v=len_trim(S) t=t+1 u=u+1 if (t==u) then if (t==1) then write(*,*) S(2:v) else t=t-1 u=u+1 write(*,*) S(1:t)//S(u:v) end if else if (t==1) then w=u-1 x=u+1 write(*,*) S(2:w)//S(x:v) else w=t-1 x=t+1 Q=S(:w)//S(x:v) o=len_trim(Q) y=u-1 z=u+1 write(*,*) Q(:y)//Q(z:o) end if end if end