#! /usr/bin/python
"""This function need two input:the string and the moving number."""
def rot13(st,t):
n=''
l=len(st)
for i in range(l):
if ord(st[i])>ord('Z'):
if (ord(st[i])+t)>ord('z'):
n=n+chr(ord(st[i])+t-26)
elif (ord(st[i])+t)<ord('a'):
n=n+chr(ord(st[i])+t+26)
else:
n=n+chr(ord(st[i])+t)
elif (ord(st[i])+t)>ord('Z'):
n=n+chr(ord(st[i])+t-26)
elif (ord(st[i])+t)<ord('A'):
n=n+chr(ord(st[i])+t+26)
else:
n=n+chr(ord(st[i])+t)
return n
s=raw_input("input s:")
t=int(raw_input("input t:"))
print rot13(s,t)
"""This function need two input:the string and the moving number."""
def rot13(st,t):
n=''
l=len(st)
for i in range(l):
if ord(st[i])>ord('Z'):
if (ord(st[i])+t)>ord('z'):
n=n+chr(ord(st[i])+t-26)
elif (ord(st[i])+t)<ord('a'):
n=n+chr(ord(st[i])+t+26)
else:
n=n+chr(ord(st[i])+t)
elif (ord(st[i])+t)>ord('Z'):
n=n+chr(ord(st[i])+t-26)
elif (ord(st[i])+t)<ord('A'):
n=n+chr(ord(st[i])+t+26)
else:
n=n+chr(ord(st[i])+t)
return n
s=raw_input("input s:")
t=int(raw_input("input t:"))
print rot13(s,t)