n = int(input()) minkyori = 200001 a = list(map(int,input().split())) for i in range(1,n) : if a[i] - a[i-1] < minkyori: minkyori = a[i] -a[i-1] print(minkyori) print(a[n-1]-a[0])