T=["" for i in range(26)] T[0] = "CpCzNkSuTbEoA"; for i in range(26): for c in T[i-1]: if c.isupper(): T[i]+=chr(65+(ord(c)-65+1)%26) else: T[i]+=chr(97+(ord(c)-97+1)%26) S=input() N=int(input()) for c in S: if c.isupper(): print(end=chr(65+(ord(c)-65+N)%26)) elif c.islower(): print(end=chr(97+(ord(c)-97+N)%26)) elif 10>int(c)+N: print(end=str(int(c)+1)) else: print(T[(N+int(c)-10)%26]) print()