N = int(input()) points = list({int(x) for x in input().split()}) if len(points) < N: min_distance = 0 else: min_distance = points[1] - points[0] max_distance = points[1] - points[0] for i in range(len(points) - 1): pi = points[i] for j in points[i + 1:]: temp = abs(j - pi) max_distance = max([max_distance,temp]) min_distance = min(min_distance,temp) print(min_distance) print(max_distance)