unit for4;
interface
  procedure Exchange(var s1,s2 : string);
  Procedure SortNum(var DB:array of string;num,count : integer);
implementation

Procedure Exchange(var s1,s2 : string);
var
 tmp : string;
begin
  tmp := s1;
  s1 := s2;
  s2 := tmp;
end;

Procedure SortNum(var DB:array of string;num,count : integer);
var
 i, j : integer;
begin
  for i := 0 to count-2 do
   for j:=count-2 downto i do
    begin
     if DB[j+1,num] > DB[j,num] then Exchange(DB[j], DB[j+1]);
    end;
end;
end.