Result

AC

Duration

1386ms

Code [DL]

sed '1h
1!{$!g
${x
:1
/T /{s/T /T/;x;s/K /K/;x}
t1
x
:2
s/K /KK/
t2
}}'

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              
                                   T              
             KKKKKKKKKKKKKKKKKKKKKKK

stderr

strace