n=int(input()) l=sorted(map(int,input().split())) a,b=float("inf"),0 for i in range(n-1): a=min(a,l[i+1]-l[i]) b=l[-1]-l[0] print(a,b,sep="\n")