#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,t;
double tem;
deque<long long> d;
cin >> n;
for(int i=0;i<n;i++){
cin >> t;
d.push_back(t);
}
if(d.back() < d.front()) reverse(d.begin(), d.end());
if(n%2==0){
tem = d[n/2]/2.0 + d[n/2-1]/2.0;
if(ceil(tem) - floor(tem) ==0) printf("%ld %.0lf %ld", d.back(), tem, d.front());
else printf("%ld %.0lf.5 %ld", d.back(), floor(tem), d.front());
}
else printf("%ld %ld %ld", d.back(), d[(n-1)/2], d.front());
return 0;
}