N = int(input()) a = list(map(int, input().split())) b = [] a.sort() for i in range(N-1): b.append(a[i+1]-a[i]) b.sort() print(b[0]) print(a[-1]-a[0])