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