N = int(input()) a = list(map(int,input().split())) a.sort() m = 10**18 for i in range(N-1): m = min(m,a[i+1]-a[i]) print(m) print(a[-1]-a[0])