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