N = int(input()) a = [int(x) for x in input().split()] print(min([int(a[x+1]-a[x]) for x in range(N-1)])) print(a[-1]-a[0])