N = int(input()) points = [int(x) for x in input().split()] points = sorted(list(set(points)),key=points.index) if len(points) < N: min_distance = 0 else: min_distance = float("inf") for i in range(len(points) - 1): temp = abs(points[i + 1] - points[i]) min_distance = min(min_distance,temp) max_distance = abs(points[-1] - points[0]) print(min_distance) print(max_distance)