N = input() A = list(map(int, input().split())) print(min(abs(x - y) for x, y in zip(A, A[1:]))) print(A[-1] - A[0])