Result

ERROR

Code [DL]

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

stdin

                                      T           
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
   K                                              

stdout

stderr

strace