import strutils, sequtils, algorithm var N, X = stdin.readLine.split.map parseInt best = int.high X.sort(cmp) for i in 1 .. X.high: let d = X[i] - X[i - 1] if d != 0: best = min(best, d) [best, 0][int(best == int.high)].echo