xiaozqh
[srcbox.git] / rqnoj / rqonj3.pas
blob72a27a8a97a5df2d475d49a8c660f3b2a5ec9c47
1 var
2 a:array [0..26] of longint;
3 s,t,w,i,j,k,p,q:longint;
4 ch:char;
6 begin
7 readln(s,t,w);
8 q:=t-s+1; p:=1;
9 for i:=1 to w do
10 begin
11 read(ch);
12 a[i]:=ord(ch)-ord('a')-s+2;
13 end;
14 for i:=1 to 5 do
15 begin
16 j:=w;
17 while (j>0) and (a[j]=t-w+j) do dec(j);
18 if j=0 then break;
19 inc(a[j]);
20 for k:=j+1 to w do a[k]:=a[j]+k-j;
21 for k:=1 to w do write(chr(ord('a')+a[k]+s-2));
22 writeln;
23 end;
24 end.