Result

AC

Duration

843ms

Code [DL]

a,*b,c=open(0);print(a*len(b)+a+f"{c.rstrip():0<{a.find('T')+1}}")

stdin

           T                                      
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
  K                                               

stdout

           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
           T                                      
  K000000000

stderr

strace