N = int(input()) X = list(map(int,input().split(" "))) a = sorted([abs(X[i] - X[i + 1]) for i in range(N) if i + 1 < N]) if a[0] == 0: print(a[1]) elif sum(a) == 0: print(0) else: print(a[0])