#include "bits/stdc++.h" using namespace std; int main() { long long N, A[1000], MIN = 100000000000; cin >> N >> A[0]; for (int i = 1; i < N; i++) { cin >> A[i]; MIN = min(MIN, A[i] - A[i - 1]); } cout << MIN << endl << A[N - 1] - A[0] << endl; }