def Main(): n=int(input()) a=list(map(int,input().split())) ans=[] for i in range(1,n): ans.append(a[i]-a[i-1]) ans.sort() print(ans[0]) print(a[n-1]-a[0]) Main()