#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define TOSTRING(x) #x #define SZ(x) (int)(x).size() #define REP(i,n) for(int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REPR(i,n) for(int i=(n)-1;i>=0;i--) #define ALL(s) (s).begin(), (s).end() #define so(V) sort(ALL(V)) #define rev(V) reverse(ALL(V)) #define uni(v) v.erase( unique(ALL(v)) , v.end()); #define PAU system("pause") typedef long long unsigned int llu; typedef long long ll; typedef vector vi; typedef vector vll; typedef vector vb; typedef vector vvi; typedef vector vvll; typedef vector vvb; const double EPS = 1e-9; const int MOD = 1e9 + 7; const int INF = (1 << 28); const double PI = acos(-1); int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vi A(N); REP(i, N)cin >> A[i]; int ans2 = A[N - 1] - A[0]; int ans1 = ans2; REP(i, N - 1) { ans1 = min(ans1, A[i + 1] - A[i]); } cout << ans1 << endl; cout << ans2 << endl; PAU; return 0; }