n = int(input()) point = input().split() d_max = int(point[1]) - int(point[0]) d_min = int(point[1]) - int(point[0]) # about max for i in range(n - 2): if int(point[i + 2]) - int(point[i + 1]) > d_max: d_max = int(point[i + 2]) - int(point[i + 1]) # about min for j in range(n - 2): if int(point[j + 2]) - int(point[j + 1]) < d_min: d_min = int(point[j + 2]) - int(point[j + 1]) print(d_min) print(d_max)