O(n)模拟,判断每种情况,按题意模拟。var a,b,c:longint; s:string;PRocedure main(p:longint);var i,j:longint;begin if s[p+1]<=s[p-1] then write('-') else if c=1 then for i:=(ord(s[p-1])+1) to (ord(s[p+1])-1) do for j:=1 to b do if a=3 then write('*') else if (s[p-1]>='a')and(s[p-1]<='z')and(a=2) then write(upcase(chr(i))) else write(chr(i)) else for i:=(ord(s[p+1])-1) downto (ord(s[p-1])+1) do for j:=1 to b do if a=3 then write('*') else if (s[p-1]>='a')and(s[p-1]<='z')and(a=2) then write(upcase(chr(i))) else write(chr(i));end;var i:longint;begin readln(a,b,c); readln(s); write(s[1]); for i:=2 to length(s)-1 do if s[i]<>'-' then write(s[i]) else if ((s[i-1]>='0')and(s[i-1]<='9')and(s[i+1]>='0')and(s[i+1]<='9'))or((s[i-1]>='a')and(s[i-1]<='z')and(s[i+1]<='a')and(s[i+1]>='z')) then main(i) else write(s[i]); writeln(s[length(s)]);end.