N = gets.to_i A = gets.split.map(&:to_i) mx = A[-1] - A[0] mn = (0...N-1).map{|i| A[i+1] - A[i]}.min puts mn, mx