program aa;
var
boo:boolean;
i,j,k,p,u,du,px,k1:integer;
f:text;
xr:array[1..50] of integer;
pr:array[1..9] of integer;
orr:array[1..2,1..50] of integer;
cr:array[1..9] of integer;
br:array[1..9,1..50] of integer;
ar:array[1..3,1..3] of integer;
dr:array[1..10] of integer;
procedure swap(var no1,no2:integer);
var
kong:integer;
begin
kong:=0;
kong:=no1;
no1:=no2;
no2:=kong;
end;
procedure huifu;
var
y:integer;
begin
y:=0;
for i:=1 to 3 do
for j:=1 to 3 do
begin
inc(y);
ar[i,j]:= br[y,k];
end;
end;
procedure zhuanhua;
var
x:integer;
begin
inc(k);
x:=0;
for i:=1 to 3 do
for j:=1 to 3 do
begin
inc(x);
br[x,k]:=ar[i,j];
var
boo:boolean;
i,j,k,p,u,du,px,k1:integer;
f:text;
xr:array[1..50] of integer;
pr:array[1..9] of integer;
orr:array[1..2,1..50] of integer;
cr:array[1..9] of integer;
br:array[1..9,1..50] of integer;
ar:array[1..3,1..3] of integer;
dr:array[1..10] of integer;
procedure swap(var no1,no2:integer);
var
kong:integer;
begin
kong:=0;
kong:=no1;
no1:=no2;
no2:=kong;
end;
procedure huifu;
var
y:integer;
begin
y:=0;
for i:=1 to 3 do
for j:=1 to 3 do
begin
inc(y);
ar[i,j]:= br[y,k];
end;
end;
procedure zhuanhua;
var
x:integer;
begin
inc(k);
x:=0;
for i:=1 to 3 do
for j:=1 to 3 do
begin
inc(x);
br[x,k]:=ar[i,j];