Result

AC

Duration

1172ms

Code [DL]

var x=0
while let l=readLine(){l.map{x=$0>"S" ?0:$0>"J" ?x-49:(x+1)%50;print(x<1 ?"x":$0,terminator:"")}
print()}

stdin

                                         T        
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
     K                                            

stdout

                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
                                         x        
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx        

stderr

/tmp/code.swift:2:26: warning: result of call to 'map' is unused
while let l=readLine(){l.map{x=$0>"S" ?0:$0>"J" ?x-49:(x+1)%50;print(x<1 ?"x":$0,terminator:"")}
                         ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

strace