n=int(input()) a=list(map(int,input().split())) b=[] for i in range(1,n): b.append(a[i]-a[i-1]) print(min(b)) print(max(a)-min(a))