$/=get;$/.say;$!=.index('K'),say $!??.subst('K','R'x$/.index("T")-$!+1)!!$/ for lines