N=gets.to_i a=gets.split(/\s/).map(&:to_i) d = [] a.each_with_index{|p1,i|a.each_with_index{|p2,j| d.push((p2-p1).abs) if i != j }} puts d.min puts d.max