N=int(input()) a=sorted(list(map(int,input().split()))) M=a[-1]-a[0] m=10**18 for i in range(N-1): m=min(a[i+1]-a[i],m) print(m) print(M)