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