var m,m1,p:string; i,c:integer; begin m1:=p; for i:=1 to length(m) do begin c:=pos[m[i],p); m1[c]:=inttostr(i); end; p:=m1; end;