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