Result

WA

Duration

907ms

Code [DL]

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

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     
          KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA     

stderr

strace