import std.algorithm; import std.array; import std.conv; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int; void main() { readint; auto xs = readints; int minDist = int.max; int maxDist = int.min; for (int i = 0; i < xs.length; i++) { for (int j = i + 1; j < xs.length; j++) { minDist = min(minDist, abs(xs[i] - xs[j])); maxDist = max(maxDist, abs(xs[i] - xs[j])); } } writeln(minDist); writeln(maxDist); }