program ex;
var
s:string;
p1,p2,p3,l,i,i1,i2,b:integer;
begin
assign(input,'expand.in');
assign(output,'expand.out');
reset(input);
rewrite(output);
readln(p1,p2,p3);
readln(s);
l:=length(s);
i:=1;
while i<=l do
begin
if s[i]='-' then
begin
if s[i-1]>=s[i+1] then
begin
write('-');
i:=i+1;
end
else if succ(s[i-1])=s[i+1] then i:=i+1
else
begin
if p1=1 then
begin
if p3=1 then
for i1:= 1 to (ord(s[i+1])-ord(s[i-1])-1) do
for i2:=1 to p2 do write(chr(ord(s[i-1])+i1))
else for i1:= (ord(s[i+1])-ord(s[i-1])-1) downto 1 do
for i2:=1 to p2 do write(chr(ord(s[i-1])+i1))
end
else
if p1=2 then
begin
if p3=1 then
for i1:= 1 to (ord(s[i+1])-ord(s[i-1])-1) do
for i2:=1 to p2 do write(chr(ord(s[i-1])+i1-32))
else for i1:= (ord(s[i+1])-ord(s[i-1])-1) downto 1 do
for i2:=1 to p2 do write(chr(ord(s[i-1])+i1-32))
end
else if p1=3 then
for i1:= (ord(s[i+1])-ord(s[i-1])-1) downto 1 do
for i2:=1 to p2 do write('*');
i:=i+1;
end;
end
else
begin
write(s[i]);
i:=i+1;
end;
end;
close(input);
close(output);
end.