n = int(input()) a = list(map(int, input().split())) dmin = 1000000 for i in range(len(a) - 1): dmin = min(dmin, a[i + 1] - a[i]) print(dmin) print(a[-1] - a[0])