//часть 1
var a: array [1..100, 1..100] of integer;
n, m, i, j : integer;
procedure zam(a1, b1: integer);
var i1, j1: integer;
begin
for i1:=1 to n do
begin
a[i1, a1]:=a[i1, a1]+a[i1, b1];
a[i1, b1]:=a[i1, a1]-a[i1, b1];
a[i1, a1]:=a[i1, a1]-a[i1, b1];
end;
end;
procedure sortSelect ();
var max, i, j: integer;
begin
for i:=1 to m do
begin
max:=i;
for j:=i to m do
if a[n,max]if i<>max then zam (i, max);
end;
end;