Result

AC

Duration

785ms

Code [DL]

a,*b,c=open(0)
i=a.find("T")
print(a+a*len(b)+(c.rstrip()+"*"*i)[:i+1])

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     
                                            T     
                                            T     
                                            T     
                                            T     
                                            T     
                                            T     
                                            T     
                                            T     
    K****************************************

stderr

strace