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