##
var n := ReadInteger;
var a := ReadArrInteger(n);
var b := a.Average;
var d := a.Select(t -> t - b).Max;
Print(b, d)
##
var n := ReadInteger;
var a := ReadArrInteger(n);
var b := a.Average;
var d := a.Select(t -> t - b).Max;
Print(b, d)