var A:array[1..8,1..9] of Integer;
N:array[1..9] of Integer;
i,j,M:integer;
C,G:real;
begin
  For i:=1 to 8 do
    For j:=1 to 9 do
    begin
    A[i,j]:=Random(-109,9);
    G:=G+A[i,j];
    end;
C:=G/(8*9);
  For i:=1 to 8 do
    For j:=1 to 9 do
      If A[i,j]>C then
      N[j]:=N[j]+A[i,j];
M:=1;
  For i:=1 to 9 do
    If N[M]<N[i] then
    M:=i;
Writeln(G,' ',C,' ',M);
  For i:=1 to 9 do
  Write(N[i]);
end.  