n = int(input()) a = list(map(int, input().split())) d = [] for q,i in enumerate(a): for w,j in enumerate(a): if q == w: continue d.append(abs(i-j)) print(min(d)) print(abs(max(a)-min(a)))