import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,*A = map(int,read().split()) diff = [y - x for x,y in zip(A, A[1:])] print(min(diff)) print(A[-1] - A[0])