#include <iostream>;
#include<algorithm>
#include<cmath>
#define maxn 100001
using namespace std;
int n;
int m[maxn];
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> m[i];
}
sort(m, m + n);
if (n % 2 == 1) {
cout << m[n - 1] << " " << m[(n - 1) / 2] << " " << m[0];
}
else {
if ((m[(n - 1) / 2 + 1] + m[(n - 1) / 2]) % 2 == 1) { cout << m[n - 1] << " " << (m[(n - 1) / 2 + 1] + m[(n - 1) / 2]) / 2 << ".5" << " " << m[0]; }
else {
cout << m[n - 1] << " " << (m[(n - 1) / 2 + 1] + m[(n - 1) / 2]) / 2 << " " << m[0];
}
}
return 0;
}