n = int(input()) A = list(map(int, input().split())) a = min(A) b = max(A) maxl = b - a minl = maxl for i in range(n-1): minl = min(minl, abs(A[i] - A[i+1])) print(minl) print(maxl)