N = int(input()) A = list(map(int, input().split())) D = [A[i+1] - A[i] for i in range(N-1)] print(min(D)) print(A[-1] - A[0])