#include #define FOR(I,X,Y) for(int (I)=(X);(I)<(Y);(I)++) #define REP(I,X,Y) for(int (I)=(Y)-1;(I)>=(X);(I)--) #define ALL(X) (X).begin(),(X).end() #define INF 1000000007 #define LINF 1000000000000000007 typedef long long ll; using namespace std; int main(){ int N,MAX=0,MIN=INF; cin >> N; int a[N]; FOR(i,0,N)cin >> a[i]; FOR(i,0,N-1){ MIN = min(MIN,a[i+1]-a[i]); } cout << MIN << endl << a[N-1] - a[0] << endl; }