from math import sqrt _ = input() a = list(map(int, input().split())) d = [ b - c for b, c in zip(a[1:], a[:-1])] print(min(d)) print(a[-1] - a[0])