uses System;
var ch,min,max,i:integer;
begin cls;
readln(ch);
min:=ch;
max:=ch;
while(ch<>0) do
begin
readln(ch);
if ((min > ch) and (ch<>0)) then min:=ch;
if max < ch then max:=ch;
inc(i);
if i > 999 then break;
end;
writeln('max = ', max);
writeln('min= ',min);
writeln('suma max + min = ',max+min);
readln;
end.