n = int(input()) line = list(map(int,input().split())) line.sort() m = max(line) - min(line) max_num = m for i in range(n-1): min_num = line[i+1] - line[i] if min_num <= m: m = min_num print(min_num) print(max_num)