import sequtils,strutils,algorithm var N = stdin.readline.parseInt X = stdin.readline.split.map(parseInt) X.sort(system.cmp) var ans = 10_000_000 for i,x in X: if i == 0: continue var d = x - X[i - 1] if d == 0: continue ans = min(d, ans) if ans == 10_000_000: echo 0 else: echo ans