const pm=3;

var a,b,pocet, i,j: integer;
    max:array[1..pm] of integer;
    ap:real;

begin

    b:=0;
    for a:=1 to pm do max[a]:=0;
    pocet:=0;
    while true do begin
         readln(a);
         if a=0 then break;
         {if a>max then
                begin
                max2:=max;
                max:= a;
                end
         else if a > max2 then max2:= a;}

         for i:=1 to pm do begin
            if max[i]<a then begin
                for j:=pm downto i+1 do begin
                        max[j]:=max[j-1];
                end;
                max[i] := a;
                break;
            end;
         end;

         b:= b + a;
         inc(pocet);
    end;
    if pocet<>0 then begin
                ap:=b/pocet;
                writeln('Priemer cisel je ',ap:0:2,'.');
                end;

    for a:=1 to pm do
    writeln(a,'. maximum je ',max[a]);

end.
