#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 1e5+10;
int A[maxn];
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&A[i]);
if(A[0]<A[n-1]) swap(A[0],A[n-1]);
printf("%d ",A[0]);
if(n%2){
printf("%d",A[n/2]);
}
else{
if((A[n/2]+A[n/2-1])%2==0)
printf("%d",(A[n/2]+A[n/2-1])/2);
else
printf("%.1f",(double)(A[n/2]+A[n/2-1])/2.0);
}
printf(" %d",A[n-1]);
return 0;
}