import itertools N = int(input().strip()) lst = [int(i) for i in input().strip().split(' ')] lst = sorted(lst) max = lst[len(lst) - 1] - lst[0] min = max for i in range(len(lst) - 1): if min > lst[i + 1] - lst[i]: min = lst[i + 1] - lst[i] print(min) print(max)