n = int(input()) a = list(map(int, input().split())) a.sort() ma = a[-1] - a[0] mi = 10**6 for i in range(n-1): d = a[i+1] - a[i] if d < mi: mi = d print(mi, ma, sep='\n')