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