var k,l,i,j,m:integer;
a:array[1..10,1..10] of integer;
begin
randomize;
for i:=1 to 10 do
for j:=1 to 10 do
a[i,j]:=random(10)-5;
for i:=1 to 10 do
begin
for j:=1 to 10 do write(a[i,j]:5);
writeln;
end;
write('K=');
readln(k);
write('L=');
readln(l);
m:=a[k,l];
for i:=1 to 10 do
for j:=1 to 10 do
if k=i then a[i,j]:=0 else if l=j then a[i,j]:=0;
a[k,l]:=m;
for i:=1 to 10 do
begin
for j:=1 to 10 do write(a[i,j]:5);
writeln;
end;
end.