n = int(input()) A = sorted(list(map(int,input().split()))) A_max = A[-1] - A[0] A_min = 10 ** 6 for i in range(0,n-1): A_min = min(A_min,abs(A[i+1]-A[i])) print(A_min) print(A_max)