input() a = set(map(int,input().split())) if len(a)<2: print(0) else: ans = max(a) for _ in range(len(a)): if a: i = a.pop() for j in a: if abs(i-j)