Result

AC

Duration

860ms

Code [DL]

a,*b,c=*$<;puts a,b.map{a};puts' '*(g=c=~/K/)+?a*(1-g+(a=~/T/))

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      
                  aaaaaaaaaaaaaaaaaaaaaaaaaa

stderr

strace