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