n=int(input()) a=list(map(int,input().split())) a.sort() ansmax = a[n-1]-a[0] ansmin = 10**12 for i in range(n-1): sa = a[i+1]-a[i] ansmin = min(sa, ansmin) print(ansmin) print(ansmax)