N=int(input()) a=list(map(int,input().split())) distance=[] for i in range(N-1): distance.append(a[i+1]-a[i]) minimum=min(distance) maximum=a[-1]-a[0] print(minimum) print(maximum)