n = int(input()) l = list(map(int,input().split())) ans = l[0]-l[1] for i in range(n-1): ans = min(ans,abs(l[i]-l[i+1])) print(ans) print(max(l)-min(l))