#include #define rep(i,n)for(long long i=0;i<(n);i++) using namespace std; typedef unsigned long long ull; typedef long long ll; const ll INF=1e18; const int MOD=1e9+7; const double pi=acos(-1); int main(){ int n; cin >> n; vectorvec(n); rep(i,n) cin >> vec[i]; sort(vec.begin(),vec.end()); ll m=INF,M=vec[n-1]-vec[0]; rep(i,n-1){ m=min(m,vec[i+1]-vec[i]); } cout << m << endl; cout << M << endl; }