Program HOC24;
var a: array[1..15] of integer;
tg,i,n,j: integer;
begin
n:=15;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to 7 do
for j:=i+1 to 8 do
if a[i]>a[j] then
begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
for i:=9 to 14 do
for j:=i+1 to 15 do
if a[i]<a[j] then
begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
for i:=1 to n do write(a[i],' ');
readln
end.