Program n1;
type x=record
name: string[50];
surname: string[50];
rus,mat,inf,obc: integer;
end;
var a: array[1..50] of x;
f: text;
s: string;
i,n,r,k: integer;
begin
assign(f,'input.txt');
reset(f);
readln(f,s);
val(s,n,i);
for i:=1 to n do begin
readln(f,s);
a[i].surname:=copy(s,1,pos(' ',s)-1);
delete(s,1,pos(' ',s));
a[i].name:=copy(s,1,pos(' ',s)-1);
delete(s,1,pos(' ',s));
val(copy(s,1,pos(' ',s)-1),r,k);
a[i].mat:=r;
delete(s,1,pos(' ',s));
val(copy(s,1,pos(' ',s)-1),r,k);
a[i].rus:=r;
delete(s,1,pos(' ',s));
val(copy(s,1,pos(' ',s)-1),r,k);
a[i].inf:=r;
delete(s,1,pos(' ',s));
val(s,r,k);
a[i].obc:=r;
end;
close(f);
writeln('Средний балл');
writeln('--------------------');
r:=0;
for i:=1 to n do r:=r+a[i].mat;
writeln('Математика: ',r/n);
r:=0;
for i:=1 to n do r:=r+a[i].rus;
writeln('Русский язык: ',r/n);
r:=0;
for i:=1 to n do r:=r+a[i].inf;
writeln('Информатика: ',r/n);
r:=0;
for i:=1 to n do r:=r+a[i].obc;
writeln('Обществознание: ',r/n);
r:=0;
end.