N, *A = map(int, open(0).read().split()) D = [b - a for a, b in zip(A, A[1:])] print(min(D)) print(A[-1] - A[0])