n = int(input()) arr = map(int,raw_input().split()) ans = float("inf") for i in range(n-1): ans = min(ans,arr[i+1] - arr[i]) print ans print arr[n-1] - arr[0]