Result

AC

Duration

722ms

Code [DL]

o=io.read
i=o"l"
j=i
r=i:find"T"
while not j:find"K"do
print(i)
j=o"l"
end
l=j:find"K"-1
f=i.rep
print(f(" ",l)..f("K",r-l))

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                                    
     KKKKKKKKK

stderr

strace