n = int(input()) a = list(map(int, input().split())) mi = float("inf") for i in range(1, n): mi = min(mi, a[i] - a[i - 1]) print(mi) print(a[-1] - a[0])