import sys N = int(input()) a = list(map(int, input().split())) min = sys.maxsize for i in range(N - 1): if min > a[i + 1] - a[i]: min = a[i+1] - a[i] print(min) print(a[N - 1] - a[0])