program hh; uses crt;
const n=20;
type team=record
name:string;
score:integer;
end;
list=array[1..n] of team;
var a:list; k,i,j:byte;m:team; f:text;
begin
assign(f, 't1.txt');
reset(f);
for k:=1 to n do
with a[k] do begin
readln(f,name);
readln(f,score);
end;
close(f);
assign(f, 't2.txt');
rewrite(f);
for j:=1 to n-1 do
for i:=n downto j+1 do
if a[i].score>a[i-1].score then begin
m:=a[i];
a[i]:=a[i-1];
a[i-1]:=m;
end;
writeln(f, 'raspred po mestam');
for i:=1 to n do
writeln(f,i,'mesto: ',a[i].name);
close(f);assign(f, 't1.txt');
reset(f);
for k:=1 to n do
with a[k] do begin
readln(f,name);
readln(f,score);
end;
close(f);
readln;
end.