var a:array[0..9] of integer;
i,min,max:integer;
begin
for i:=0 to 9 do readln(a[i]);
min:=a[0];
for i:=0 to 9 do if(min>a[i]) then min:=a[i];
max:=a[0];
for i:=0 to 9 do if(max<a[i]) then max:=a[i];
writeln(max,' ', min);
readln;
end.
var a:array[0..9] of integer;
i,min,max:integer;
begin
for i:=0 to 9 do readln(a[i]);
min:=a[0];
for i:=0 to 9 do if(min>a[i]) then min:=a[i];
max:=a[0];
for i:=0 to 9 do if(max<a[i]) then max:=a[i];
writeln(max,' ', min);
readln;
end.