#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
int sum=0,score,max=0,min=11;
double averge;
for(int i=0;i<n;i++)
{
scanf("%d",&score);
sum+=score;
printf("%d\n",sum);
if(score>max){
max=score;
}
if(score<min)
{
min=score;
}
}
sum=sum-max-min;
printf("%d\n",sum);
printf("%.2f",sum*1.0/(n-2));
return 0;
}