n = int(input()) a = sorted(map(int, input().split())) mi = min([a[i+1] - a[i] for i in range(n-1)]) ma = a[-1] - a[0] print(mi, ma, sep='\n')