import std.algorithm, std.array, std.container, std.range; import std.string, std.conv; import std.math, std.bigint, std.bitmanip, std.random; import std.stdio, std.typecons; const auto repeat = 10 ^^ 6; void main() { auto n = readln.chomp.to!int; auto xi = readln.split.map!(to!int).array; auto yi = xi.sort().uniq.array; if (yi.length >= 2) writeln(iota(yi.length - 1).map!(i => yi[i + 1] - yi[i]).reduce!(min)); else writeln(0); }