class L1metric(object): def __init__(self): pass def constructor(self, N, X): self.N = int(N) self.X = list(map(int, list(set(X)))) if not len(self.X) > 1: print("0") exit() def sort(self): self.X.sort() def run(self): self.sort() MinMetric = self.analysis() print(MinMetric) def analysis(self): MinMetric = 1e+5 for num1, num2 in zip(self.X, self.X[1:]): metric = num2 - num1 if metric < MinMetric: MinMetric = metric return MinMetric if __name__=="__main__": N = input() X = input().split(" ") func = L1metric() func.constructor(N=N, X=X) func.run()