#include <bits/stdc++.h>
using namespace std;
double a[310];
double cnt, m, w, p;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i < n; i++) {
for (int j = 1; j < n; j++) {
if (a[j] >= a[j+1]) {
swap(a[j], a[j + 1]);
}
}
}
m = a[n-1];
for (int i = 2; i < n; i++) {
cnt+=a[i];
}
p = cnt * 1.0 / (n * 1.0 - 2);
w = m * 1.0 - p * 1.0;
cout << p << ' ' << w;
return 0;
}