program expand;
var i,j,k,p1,p2,p3,o:integer;
input:string;
output:array[1..10000]of char;
go:boolean;
f1:text;
begin
assign(f1,'expand.in');
reset(f1);
readln(f1,p1,p2,p3);
readln(f1,input);
close(f1);
for i:=1 to length(input) do
begin
go:=false;
if (input[i]='-')and(i<>1) then
begin
if (input[i-1]>='0')and(input[i-1]<='9')and(input[i+1]>='0')and(input[i+1]<='9')and(input[i-1]<input[i+1]) then go:=true;
if (input[i-1]>='a')and(input[i-1]<='z')and(input[i+1]>='a')and(input[i+1]<='z')and(input[i-1]<input[i+1]) then go:=true;
if not(go) then
begin
inc(o);
output[o]:=input[i];
end;
if go then
begin
j:=0;
while input[i+1]<>chr(ord(input[i-1])+j+1) do
begin
j:=j+1;
for k:=1 to p2 do
begin
inc(o);
if p3=1 then
case p1 of
1:output[o]:=(chr(ord(input[i-1])+j));
2:if (input[i-1]>='a')and(input[i-1]<='z') then
output[o]:=chr(ord(input[i-1])+j-32) else
output[o]:=chr(ord(input[i-1])+j);
3:output[o]:='*';
end else
case p1 of
1:output[o]:=(chr(ord(input[i+1])-j));
2:if (input[i+1]>='a')and(input[i+1]<='z') then
output[o]:=chr(ord(input[i+1])-j-32) else
output[o]:=chr(ord(input[i+1])-j);
3:output[o]:='*';
end;
end;
end;
end;
end else begin inc(o); output[o]:=input[i]; end;
end;
assign(f1,'expand.out');
rewrite(f1);
for i:=1 to o do
write(f1,output[i]);
close(f1);
end.