#include using namespace std; int main() { int N; cin >> N; int maa = INT32_MIN; int mia = INT32_MAX; int mi = INT32_MAX; int last = INT32_MIN; for( int i = 0; i < N; i++ ) { int a; cin >> a; if( last == INT32_MIN ) last = a; else { int d = a - last; if( d < mi ) mi = d; last = a; } if( a > maa ) maa = a; if( a < mia ) mia = a; } cout << mi << endl; cout << maa - mia << endl; }