#include #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair P; const int INF = 1e15; signed main(){ int n; cin >> n; vector a(n); rep(i, 0, n){ cin >> a[i]; } int MAX = a[n - 1] - a[0]; int MIN = MAX; rep(i, 0, n - 1){ MIN = min(MIN, a[i + 1] - a[i]); } cout << MIN << endl << MAX << endl; }