#include #define MAX_N 100001 #define INF_INT 2147483647 #define INF_LL 9223372036854775807 #define REP(i,n) for(int i=0;i<(int)(n);i++) using namespace std; typedef long long int ll; typedef pair P; int main() { int m=99999999,N,a[1001]; cin >> N; REP(i,N)cin >> a[i]; sort(a,a+N); REP(i,N-1)m = min(m,a[i+1]-a[i]); cout << m << endl; cout << (a[N-1]-a[0]) << endl; return 0; }