#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; int main() { int n, k[1005], mi = INF; cin >> n; for (int i = 0; i < n; ++i) { cin >> k[i]; } sort(k, k + n); for (int i = 1; i < n; ++i) { mi = min(mi, abs(k[i] - k[i - 1])); } cout << mi << endl << abs(k[n - 1] - k[0]) << endl; }