N = int(input()) l = sorted(list(map(int, input().split()))) print(min([l[i+1]-l[i] for i in range(len(l)-1)])) print(max(l)-min(l))