i,j,k,n,x:longint;
a:array[1..1000]of longint;
b:array[1..1000]of longint;
tot:real;
procedure init;
begin
readln(n);
for i:=1 to n do
read(a[i]);
end;
procedure so(al,ar:longint);
var
ii,jj:longint;
begin
for ii:=al to ar-1do
for jj:=ii+1 to ar do
if b[jj]<b[ii] then begin
x:=b[ii];b[ii]:=b[jj];b[jj]:=x;
end;
end;
procedure sort;
begin
for i:=1 to n do b[i]:=i;
for i:=1 to n-1do
for j:=i+1 to n do
if a[j]<a[i] then begin
x:=a[i];a[i]:=a[j];a[j]:=x;
x:=b[i];b[i]:=b[j];b[j]:=x;
end;
i:=1;j:=i;
repeat
while(a[i]=a[i+1])and(i<n)do inc(i);
if i<>j then so(j,i);
inc(i);j:=i;
until i>=n;
end;
procedure doit;
begin
sort;
for i:=1 to n-1 do write(b[i],’ ’);
writeln(b[n]);
for i:=2 to n do
inc(a[i],a[i-1]);
k:=0;
for i:=1 to n-1 do
inc(k,a[i]);
tot:=k/n;
writeln(tot:0:2);
end;
begin
init;doit;
end.