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