N = int(input()) A = [int(i) for i in input().split()] max = A[N-1] - A[0] min = 1000000000000 for i in range(len(A)-1): if(A[i+1] - A[i] < min): min = A[i+1] - A[i] print(min) print(max)