#const alph_lower="abcdefghijklmnopqrstuvwxyz" alph_upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" #process S=input() N=int(input()) #数字をなくすために最大10回ずらす for i in range(10): if N==0:break S=S.translate(str.maketrans(dict(zip(alph_lower,alph_lower[1:]+alph_lower[:-1])))) S=S.translate(str.maketrans(dict(zip(alph_upper,alph_upper[1:]+alph_upper[:-1])))) S=S.translate(str.maketrans(dict(zip("0123456789",["1","2","3","4","5","6","7","8","9","CpCzNkSuTbEoA"])))) N-=1 N=N%26 S=S.translate(str.maketrans(dict(zip(alph_lower,alph_lower[N:]+alph_lower[:-N])))) S=S.translate(str.maketrans(dict(zip(alph_upper,alph_upper[N:]+alph_upper[:-N])))) print(S)