N: int = int(input()) X = list(map(int, input().split())) distance = 0 for i in range(len(X)): for j in range(len(X)): ij_distance = abs(X[i] - X[j]) if ij_distance == 0: continue if distance == 0 or ij_distance < distance: distance = ij_distance print(str(distance))