n = int(input()) a = list(map(int,input().split())) ma = a[n-1]-a[0] mi = 10**18 for i in range(1,n): mi = min(mi,a[i]-a[i-1]) print(mi) print(ma)