Result

AC

Duration

1202ms

Code [DL]

main=interact$unlines.s(!).lines
a!b|(x,y)<-span(<'J')$zipWith max a b=x++s max y
s=scanr1

stdin

           T                                      
                                                  
                                                  
                                                  
   K                                              

stdout

   TTTTTTTTT                                      
   K                                              
   K                                              
   K                                              
   K                                              

stderr

strace