#include #include #include #include using namespace std; int main() { int n; vector a; bool flag=false; cin >> n; for (int i = 0;i < n;i++) { int buf; cin >> buf; a.push_back(buf); } sort(a.begin(), a.end()); for (int i = 0;i < a.size()-1;i++) { if (a[i] == a[i + 1])flag = true; } if (flag)cout << 0 << endl; else cout << abs(a[1] - a[0]) << endl; cout << abs(a[a.size() - 1] - a[0]) << endl; return 0; }