var
a:array[1..26,1..26] of char;
s,ss:ansistring;
i,j,l,r,tem,t:longint;
ch:char;
begin
assign(input,'vigenere.in');reset(input);
assign(output,'vigenere.out');rewrite(output);
readln(s);
readln(ss);
for i:=1 to 26 do
for j:=1 to 26 do
begin
tem:=i+j+63;
if tem>90 then tem:=tem-26;
a[i,j]:=chr(tem);
end;
while length(s)<length(ss) do
s:=s+s;
for i:=1 to length(ss) do
begin
t:=0;
if (s[i]>='A') and (s[i]<='Z') then l:=ord(s[i])-64;
if (s[i]>='a') and (s[i]<='z') then l:=ord(s[i])-96;
if (ss[i]>='A') and (ss[i]<='Z') then
for j:=1 to 26 do
if a[l,j]=ss[i] then
ch:=chr(j+64);
if (ss[i]>='a') and (ss[i]<='z') then
for j:=1 to 26 do
if ord(a[l,j])=ord(ss[i])-32 then
ch:=chr(j+96);
write(ch);
end;
close(input);close(output);
end.