Result

AC

Duration

936ms

Code [DL]

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

stdin

                                     T            
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
     K                                            

stdout

                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
                                     T            
     RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR                                            

stderr

strace