#include using namespace std; int main() { int n; vector v; cin >> n; int tmp; for (int i = 0; i < n; i++) { cin >> tmp; v.push_back(tmp); } sort(v.begin(), v.end()); int mx = v[n - 1] - v[0]; int mn = 200010; for (int i = 0; i < n - 1; i++) { mn = min(v[i + 1] - v[i], mn); } cout << mn << endl << mx << endl; return 0; }