Result

AC

Duration

1180ms

Code [DL]

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

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                    
    xxxxxxxxxxxxxxxxxxxxxxxxxx                    

stderr

/tmp/code.swift:3:3: warning: result of call to 'map' is unused
l.map{x=$0>"S" ?0:$0>"J" ?x-49:(x+1)%50;s+="\(x<1 ?"x":$0)"}
  ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

strace