var i,t,k: integer; s,st: string; begin readln(s,k); st:=''; k:=k mod 26; for i:=1 to length(s) do if upcase(s[i]) in ['a'..'z'] then begin t:=ord(s[i]) + k; if ((t > 90) and (t < 97)) or (t > 122) then dec(t,26); st:=st + chr(t); end else st:=st + t; write(st); end.