#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector As(N, 0); for (auto &a : As) cin >> a; int maxSpan = As[N - 1] - As[0]; int minSpan = maxSpan; for (int i = 1; i < N; ++i){ minSpan = min(minSpan, As[i] - As[i - 1]); } cout << minSpan << endl; cout << maxSpan << endl; return 0; }