def getlist(): return list(map(int, input().split())) N = int(input()) a = getlist() m = float("inf") for i in range(N - 1): if a[i + 1] - a[i] < m: m = a[i + 1] - a[i] print(m) print(a[-1] - a[0])