if boo=true then begin
zhuanhua;
swap(ar[orr[1,p],orr[2,p]],ar[orr[1,p]+1,orr[1,p]]);
{hui fu mei you jiao huan de er wei biao}
end;
end;
if orr[2,p]>1 then begin
swap(ar[orr[1,p],orr[2,p]],ar[orr[1,p],orr[2,p]-1]);
same;
if boo=true then begin
zhuanhua;
swap(ar[orr[1,p],orr[2,p]],ar[orr[1,p]+1,orr[2,p]-1]);
{hui fu mei you jiao huan de er wei biao}
end;
end;
if orr[2,p]<3 then begin
swap(ar[orr[1,p],orr[2,p]],ar[orr[1,p],orr[2,p]+1]);
same;
if boo=true then begin
zhuanhua;
swap(ar[orr[1,p],orr[2,p]],ar[orr[1,p],orr[2,p]+1]);
{hui fu mei you jiao huan de er wei biao}
end;
end;
inc(p);
for i:=1 to 3 do
for j:=1 to 3 do
begin
inc(u);
ar[i,j]:=br[u,p];
end;
dr[p]:=k;{dr li cun de shi mei ci fen zhi de shu ji bu shi 3 jiu shi 4,bian yu da yin jie guo}
until
(br[1,k]=cr[1])and (br[2,k]=cr[2]) and (br[3,k]=cr[3])and( br[4,k]=cr[4])and
(br[5,k]=cr[5])and (br[6,k]=cr[6])and (br[7,k]=cr[7])and
(br[8,k]=cr[8])and (br[9,k]=cr[9]);
assign(f,'rui.txt');
rewrite(f);
write(f,p);
end.