N = int(input()) a = list(map(int, input().split())) m = 2*10**5 for i in range(N-1): m = min(m, a[i+1]-a[i]) print(m) print(a[-1] - a[0])