Result

AC

Duration

1015ms

Code [DL]

s=""+require("fs").readFileSync(0);console.log(s.replace(RegExp(`(\n.{${s.search(/T/)}}).`,"g"),"$1#").replace(/K */,m=>"K".repeat(m.length)))

stdin

                                               T  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                K                 

stdout

                                               T  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                               #  
                                KKKKKKKKKKKKKKK#  

stderr

strace