#include <stdio.h>
struct student
{
char xh[6];
char xm[10];
double cj;
};
int main()
{
int n,i;
double sum=0;
struct student students[10]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s",&students[i].xh);
scanf("%s",&students[i].xm);
scanf("%lf",&students[i].cj);
sum=sum+student[i].cj;
}
printf("%.2lf\n",sum/n);
for(i=0;i<n;i++)
{
if(students[i].cj<sum/n)
{
printf("%s %s\n",students[i].xm,students[i].xh);
}
}
return 0;
}