Result

WA

Duration

884ms

Code [DL]

a=gets;puts a while gets!~/K/;$_[a=~/T/]=?A;0while$_.sub!'K ','KK';puts

stdin

             T                                    
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
         K                                        

stdout

stderr

/volume/CODE:1:in `<main>': undefined method `gets!' for main:Object (NoMethodError)
Did you mean?  gets

strace