var
a,b:string[1];
n,m,i:integer;
k:string[100];
Begin
assign(input,'vigenere.in');reset(input);
assign(output,'vigenere.out');rewrite(output);
readln(k);i:=0;
repeat
inc(i);
if i>length(k) then i:=1;
read(a);b:=k[i];
if (ord(a[1])>=65)and(ord(a[1])<=90) then
begin
if (ord(b[1])>=97)and(ord(b[1])<=122) then b:=chr(ord(b[1])-32);
n:=65;m:=90;
end
else
begin
if (ord(b[1])>=65)and(ord(b[1])<=90) then b[1]:=chr(ord(b[1])+32);
n:=97;m:=122;
end;
if (ord(a[1])>=ord(b[1]))and(a<>'') then write(chr(n+ord(a[1])-ord(b[1])))
else if (ord(a[1])<ord(b[1]))and(a<>'') then write(chr(m-ord(b[1])+ord(a[1])+1));
until a='';
close(input);close(output);
end.