text: def encrypt(text,s): 
      result = "" 
  
      for i in range(len(text)): 
          char = text[i] 
  
          if (char.isupper()): 
              result += chr((ord(char) + s-65) % 26 + 65) 
  
          else: 
              result += chr((ord(char) + s - 97) % 26 + 97) 
    
      return result 
    
  #check the above function 
  text = input()
  s = int(input())
  print("OLD SENTENCE IS : ")
  print(text)
  
  words = text.split()
  
  print("NEW SENTENCE IS : ")
  for i in words:
      print(encrypt(i,s),end=" ")
  