def min(a,b); a < b ? a : b; end N = gets.to_i A = gets.split.map(&:to_i).sort dmax = A[-1] - A[0] dmin = A.each_cons(2).inject(dmax){|d,(a,b)| min(d,b-a) } puts [dmin, dmax]