n=int(input()) a=list(map(int,input().split())) a.sort() amax=a[-1]-a[0] amin(amax) for i in range(n-1): amin=min(amin,a[i+1]-a[i]) print(amin) print(amax)