import strutils, sequtils, algorithm var N, X = stdin.readLine.split.map parseInt best = int.high X = X.deduplicate.sorted(cmp) for i in 0 ..< X.high: best = min(best, X[i + 1] - X[i]) echo best