#include #define rep(i, x) for(ll i = 0; i < x; i++) #define rep2(i, x) for(ll i = 1; i <= x; i++) #define all(a) (a).begin(),(a).end() using ll = long long; using ld = long double; const ll INF = 10000000000000000; using namespace std; signed main() { ll n, ans = INF; cin >> n; vector v(n); rep(i, n) { cin >> v[i]; if (i != 0) { ans = min(ans, v[i] - v[i - 1]); } } cout << ans << endl; cout << v[n - 1] - v[0] << endl; return 0; }